You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bootRepackage depends on EAR plugin task causing circular dependencies between tasks #3931
Which version of Boot are you using? I think this problem may be caused by the application plugin which Boot's plugin applies for you in 1.2.x. 1.3.0 no longer applies the application plugin so if you're using 1.2.x, please try with 1.3.0.M5.
Something that I can just unzip/clone and run would certainly help. I can't see where common.gradle is coming from at the moment, for example.
I'm also a bit confused by a few things:
Why do you have a single project that produces a war and an ear? I'd typically expect the ear to be created by a separate project that consumes one or more wars from other projects.
Why are you using bootRepackage, which creates an executable war, if you're then trying to wrap everything in an ear which needs to be deployed to an app server?
there is need only for 1 war per ear. Ear is used to set proper webmodule context. There are no ejbs or other war modules
it's executable war with provided tomcat libs so later I'll be able to run same war during testing using embedded tomcat + package same war into ear to run on any env (uat, pre-prd) with internal app server which is not tomcat at all
I know that issue can be fixed easily moving ear packaging into another prj that depends on war. If there are no other workarounds I will go with this approach.
Thanks. That's helped a lot. The problem is that the bootRepackage task is configured to depend on all of the tasks that contribute artifacts to the project's archives configuration:
That creates a cycle as the one artifact is the ear file. The creation of the ear file depends on bootRepackage as you've configured it to contain the repackaged war file:
dependencies {
deploy files(bootRepackage)
}
There's no need for bootRepackage to depend on the ear task so that's something that we can improve. In the meantime, you could package the original war file in the ear and keep the repackaged version separate to use for testing. To do that, you just need to change the dependencies of the deploy configuration:
This will work of course - as it packs original war into ear removing circular dependency.
Btw I tried to move ear packaging into a separate project that depends on :war project - it doesn't work as well as there is no registered outgoing bootRepackage artifact. Are there any ways to make ear packaging project to depend on bootRepackage output?
the next sctipt snippet picks up war archive configuration and doesn't see bootrepackage one:
For all fighting this, snippet from my workaround:
//if you need to do sth like this:
project.artifacts {
myConf myTaskDependantOnBootRepackage
}
//you can remove then bootRepackage dependencies to Archives like this:
project.tasks.matching {it.name == "bootRepackage"}.each {
Set<Object> deps = it.taskDependencies.values
def toBeeRemoved = deps.find {
it.class.name.startsWith("org.gradle.api.internal.artifacts.DefaultPublishArtifactSet")
}
deps.removeAll(toBeeRemoved)
}
Activity
oembedler commentedon Sep 9, 2015
Any ideas on how to fix this apart of using separate builds\change task dependency graph?
wilkinsona commentedon Sep 9, 2015
Which version of Boot are you using? I think this problem may be caused by the application plugin which Boot's plugin applies for you in 1.2.x. 1.3.0 no longer applies the application plugin so if you're using 1.2.x, please try with 1.3.0.M5.
oembedler commentedon Sep 9, 2015
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.5.RELEASE")
So, yes it's 1.2.5.RELESE.
Will check in few mins 1.3.0.M5 (how stable is it btw?)
oembedler commentedon Sep 9, 2015
Same issue with 1.3.0.M5
oembedler commentedon Sep 9, 2015
here is snippet from ready tasks graph:
still ear included by default.
Ear dependency comes from:
wilkinsona commentedon Sep 9, 2015
Can you share a complete
build.gradethat reproduces the problem please?oembedler commentedon Sep 9, 2015
Sure. It's multi project build.
project build.gradle (parent):
projecta build gradle (this one fails to run sequence war->bootRepackage->ear)
projectb build gradle (jar library)
oembedler commentedon Sep 9, 2015
I can send those project zipped if you want to check it out in action (should be easier to determine where issue is).
wilkinsona commentedon Sep 9, 2015
Something that I can just unzip/clone and run would certainly help. I can't see where
common.gradleis coming from at the moment, for example.I'm also a bit confused by a few things:
oembedler commentedon Sep 9, 2015
here it is https://github.com/clajder/bootRepackage-ear.git
>gradle clean buildI know that issue can be fixed easily moving ear packaging into another prj that depends on war. If there are no other workarounds I will go with this approach.
thanks
wilkinsona commentedon Sep 10, 2015
Thanks. That's helped a lot. The problem is that the
bootRepackagetask is configured to depend on all of the tasks that contribute artifacts to the project's archives configuration:That creates a cycle as the one artifact is the ear file. The creation of the ear file depends on
bootRepackageas you've configured it to contain the repackaged war file:dependencies { deploy files(bootRepackage) }There's no need for
bootRepackageto depend on theeartask so that's something that we can improve. In the meantime, you could package the original war file in the ear and keep the repackaged version separate to use for testing. To do that, you just need to change the dependencies of the deploy configuration:dependencies { deploy files(war) }oembedler commentedon Sep 10, 2015
This will work of course - as it packs original war into ear removing circular dependency.
Btw I tried to move ear packaging into a separate project that depends on :war project - it doesn't work as well as there is no registered outgoing bootRepackage artifact. Are there any ways to make ear packaging project to depend on bootRepackage output?
the next sctipt snippet picks up war archive configuration and doesn't see bootrepackage one:
how to reference for packaging bootRepackage task output?
wilkinsona commentedon Sep 10, 2015
Perhaps you could add the output of the bootRepackage task to a new
repackagedArchivesconfiguration and then depend on that?20 remaining items
s4s0l commentedon Mar 21, 2017
For all fighting this, snippet from my workaround:
Introduce bootJar and bootWar tasks for creating fat jars and wars