Copying sibling sub-project's WAR no longer working with M5

(Jamie Bisotti) #1

I have a multi-project build that has been running fine with M3. I’m trying to upgrade to M5 and have run into a weird issue. Basically, one sub-project creates a WAR file (build/libs/foo.war). Another sub-project has a project dependency on the previous sub-project and tries to copy the WAR to a location within his build folder (it’s creating an installer).

This used to do the trick:

configurations {
  dependencies {
   platform project(':platform:dm-mve')
  task prepareLexmarkPlatformDir(type:Copy) {
   from configurations.platform {
   into "${cdRootDirLexmark}/platform"

But with M5, nothing gets copied. When I run -i, it says that configuration has no sources.

Anyone have a clue what’s wrong?


(detelinyordanov) #2

I already had similar issues, I think the reason for your problem is that in M5 the ‘default’ configuration does not extend ‘archives’ configuration anymore: M5 Migration Guide - Artifact Publication

So changing your dependency to reference the ‘archives’ configuration should help:

dependencies {

platform project( [ path: ‘:platform:dm-mve’, configuration: ‘archives’ ] )


(Jamie Bisotti) #3

I actually saw that note in the migration guide just a while ago. I took the approach, of modifying the other side of the equation (changed my artifact to be part of the ‘runtime’ configuration). Thanks for the help.

(spencer_allain) #4

So, as one of the people involved with the changes to jars/wars/ears for M5, the intent was/is to also add an additional configuration called something like ‘earComponents’ for the war plugin where the war output would go by default, and an ejb-jar plugin would be added that would simply associate the jar output into said configuration as well. Then any ear project would simply pull from this configuration for any other projects that it depended upon.

As you can see, that didn’t happen in M5, but it is on the roadmap… just need to find time to implement and test it. Other folks have been focused on the performance/cache issues.

(Leonard Brünings) #5

This feature would be really usefull