gradle multiproject build for grails - cant assemble project with hibernate dependency -
i have built multi project gradle build grails project , - i'm getting unusual error when add together hibernate4 dependency -
without project builds fine - can utilize grails assemble task on route project - works fine , run , connect .
however add together hibernate4 dependency , seek , assemble
[sts] ----------------------------------------------------- [sts] starting gradle build next tasks: [sts] assemble [sts] ----------------------------------------------------- :myitilapp:war |loading grails 2.4.4 |configuring classpath error | fatal error forking grails jvm: null error | java.lang.reflect.invocationtargetexception error | @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) error | @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) error | @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) error | @ java.lang.reflect.method.invoke(method.java:606) error | @ org.grails.launcher.util.reflectionutils.invokemethod(reflectionutils.java:57) error | @ org.grails.launcher.context.delegatinggrailslaunchcontext.launch(delegatinggrailslaunchcontext.java:409) error | @ org.grails.launcher.reflectivegrailslauncher.launch(reflectivegrailslauncher.java:32) error | @ org.grails.launcher.inprocessgrailslauncher.launch(inprocessgrailslauncher.java:27) error | @ org.grails.launcher.main.run(main.java:62) error | @ org.grails.launcher.main.main(main.java:38) error | **caused by: java.lang.linkageerror:** loader constraint violation: when resolving overridden method "org.apache.tools.ant.helper.projecthelper2$roothandler.setdocumentlocator(lorg/xml/sax/locator;)v" class loader (instance of org/grails/launcher/rootloader/rootloader) of current class, org/apache/tools/ant/helper/projecthelper2$roothandler, , superclass loader (instance of <bootloader>), have different class objects type andler.setdocumentlocator(lorg/xml/sax/locator;)v used in signature error | @ org.apache.tools.ant.helper.projecthelper2.parseunknownelement(projecthelper2.java:131) error | @ org.apache.tools.ant.helper.projecthelper2.parseantlibdescriptor(projecthelper2.java:111) error | @ org.apache.tools.ant.taskdefs.antlib.createantlib(antlib.java:91) error | @ org.apache.tools.ant.taskdefs.definer.loadantlib(definer.java:440) error | @ org.apache.tools.ant.taskdefs.definer.execute(definer.java:292) error | @ org.apache.tools.ant.componenthelper.checknamespace(componenthelper.java:877) error | @ org.apache.tools.ant.componenthelper.getdefinition(componenthelper.java:308) error | @ org.apache.tools.ant.componenthelper.createcomponent(componenthelper.java:285) error | @ org.apache.tools.ant.componenthelper.createcomponent(componenthelper.java:264) error | @ org.apache.tools.ant.unknownelement.makeobject(unknownelement.java:417) error | @ org.apache.tools.ant.unknownelement.maybeconfigure(unknownelement.java:163) error | @ groovy.util.antbuilder.performtask(antbuilder.java:314) error | @ groovy.util.antbuilder.nodecompleted(antbuilder.java:264) error | @ groovy.util.buildersupport.doinvokemethod(buildersupport.java:147) error | @ groovy.util.antbuilder.doinvokemethod(antbuilder.java:203) error | @ groovy.util.buildersupport.invokemethod(buildersupport.java:64) error | @ org.codehaus.gant.gantbuilder.invokemethod(gantbuilder.java:99) error | @ org.codehaus.groovy.runtime.callsite.pogometaclasssite.call(pogometaclasssite.java:45) error | @ org.codehaus.groovy.runtime.callsite.callsitearray.defaultcall(callsitearray.java:45) error | @ org.codehaus.groovy.runtime.callsite.abstractcallsite.call(abstractcallsite.java:108) error | @ org.codehaus.groovy.runtime.callsite.abstractcallsite.call(abstractcallsite.java:116) error | @ org.codehaus.gant.gantbinding.initializegantbinding(gantbinding.groovy:108) error | @ org.codehaus.gant.gantbinding.<init>(gantbinding.groovy:42) error | @ org.codehaus.groovy.grails.cli.grailsscriptrunner.executescriptwithcaching(grailsscriptrunner.java:430) error | @ org.codehaus.groovy.grails.cli.grailsscriptrunner.callpluginorgrailsscript(grailsscriptrunner.java:416) error | @ org.codehaus.groovy.grails.cli.grailsscriptrunner.executecommand(grailsscriptrunner.java:380) error | @ org.codehaus.groovy.grails.cli.grailsscriptrunner.executecommand(grailsscriptrunner.java:347) error | ... 10 more :myitilapp:war failed failure: build failed exception. * went wrong: execution failed task ':myitilapp:war'. > process 'command 'c:\program files\java\jdk1.7.0_51\bin\java.exe'' finished non-zero exit value 1 * try: run --stacktrace alternative stack trace. run --info or --debug alternative more log output. build failed total time: 11.931 secs [sts] build failed org.gradle.tooling.buildexception: not execute build using gradle distribution 'https://services.gradle.org/distributions/gradle-2.1-bin.zip'. @ org.gradle.tooling.internal.consumer.resulthandleradapter.onfailure(resulthandleradapter.java:53) @ org.gradle.tooling.internal.consumer.async.defaultasyncconsumeractionexecutor$1$1.run(defaultasyncconsumeractionexecutor.java:57) @ org.gradle.internal.concurrent.defaultexecutorfactory$stoppableexecutorimpl$1.run(defaultexecutorfactory.java:64) @ java.util.concurrent.
here top level build.gradle file (tried downloading via hibernate-core , same problem
import org.grails.gradle.plugin.tasks.grailstask buildscript { repositories { maven {url "http://repo.grails.org/grails/core"} } dependencies { classpath "org.grails:grails-gradle-plugin:2.1.1" } } subprojects { //if grails-app in subproject apply grails-app plugin project if (project.file ("grails-app").exists()) { apply plugin: 'grails' repositories { grails.central() mavencentral() } dependencies { runtime "org.grails.plugins:tomcat:8.0.14.1" // no container deployed default, add together //compile 'org.grails.plugins:resources:1.2.13' // deprecated asset-plugin compile "org.grails.plugins:asset-pipeline:1.9.9" compile "org.grails.plugins:scaffolding:2.1.2" compile "org.grails.plugins:hibernate4:4.3.6.1" //add hibernate //compile "org.hibernate:hibernate-core:4.3.7.final" //add hibernate compile "org.grails.plugins:database-migration:1.4.0" compile 'org.grails.plugins:cache:1.1.8' //, "org.grails.plugins:cache-ehcache:1.0.4" runtime "org.grails.plugins:jquery:1.11.1" /* compile 'org.grails.plugins:webxml:1.4.1' */ //testcompile 'junit:junit:4.8.2' // testcompile group: 'junit', name: 'junit', version: '4.+' } //grails class added grails plugin - set properties grails { grailsversion = '2.4.4' groovyversion = '2.3.7' springloadedversion '1.2.1' } //make sure have plenty build space tasks.withtype (org.grails.gradle.plugin.tasks.grailstask) {task t -> t.jvmoptions { jvmargs "-xms512m", "-xmx4g", "-xx:maxpermsize=512m" } } } else { apply plugin: 'groovy' } apply plugin: 'eclipse' grouping = 'com.softwood' version = '0.1-snapshot' /* jar { manifest.attributes provider: 'my cool company' } */ }
any body knows , how can prepare - i'm pretty close seem build hibernate going. appreciate insight , prepare
this answer indicates 'xml-apis' needs excluded. alter scope runtime
:
runtime('org.grails.plugins:hibernate4:4.3.6.1') { exclude module: 'xml-apis' }
grails gradle
No comments:
Post a Comment