repaint-io / maven-tiles

Injecting maven configurations by composition rather than inheritance
154 stars 32 forks source link

tiles breaks maven-deploy-plugin when deployAtEnd=true #81

Open cjnygard opened 6 years ago

cjnygard commented 6 years ago

In order to diagnose this issue, I pulled the source code for maven-deploy-plugin and added some logging to the logic which determines when maven-deploy-plugin thinks it's at the end and triggers the queued deployments. Here's excerpts from the maven build log:

[INFO] --- maven-deploy-plugin:3.0.0-SNAPSHOT:deploy (default-deploy) @ gopher-features ---
[INFO] Processing [38/43]
[INFO] Ready [false]
[INFO] Deploying com.cengage.ccp.gopher:gopher-features:1.0.4-SNAPSHOT at end
[INFO] 

NOTE:  Next one is from the one sub-module which uses maven-tile-plugin.  Note the counter, should have been 39/43

[INFO] --- maven-deploy-plugin:3.0.0-SNAPSHOT:deploy (default-deploy) @ gopher-guide ---
[INFO] Processing [1/43]
[INFO] Ready [false]
[INFO] Deploying com.cengage.ccp.gopher:gopher-guide:1.0.4-SNAPSHOT at end

[INFO] 
[INFO] --- maven-deploy-plugin:3.0.0-SNAPSHOT:deploy (default-deploy) @ gopher-deployer ---
[INFO] Processing [39/43]
[INFO] Ready [false]
[INFO] Deploying com.cengage.ccp.gopher:gopher-deployer:1.0.4-SNAPSHOT at end
[INFO] 

[INFO] --- maven-deploy-plugin:3.0.0-SNAPSHOT:deploy (default-deploy) @ gopher-indexer-service ---
[INFO] Processing [40/43]
[INFO] Ready [false]
[INFO] Deploying com.cengage.ccp.gopher:gopher-indexer-service:1.0.4-SNAPSHOT at end
[INFO] 

NOTE:  skip ahead a few, here's the last one

[INFO] --- maven-deploy-plugin:3.0.0-SNAPSHOT:deploy (default-deploy) @ gopher-listener ---
[INFO] Processing [42/43]
[INFO] Ready [false]
[INFO] Deploying com.cengage.ccp.gopher:gopher-listener:1.0.4-SNAPSHOT at end
[INFO] 

Reactor summary shows gopher-listener being the last module which is built.

In this build, the maven-tile-plugin was enabled by a profile flag on the command line. Re-running the build without enabling the profile (and therefore not running the maven-tile-plugin) yields proper count of 43/43 at the end and triggers the deploy.

Any clues on how to fix this issue?

khmarbaise commented 6 years ago

The only way to fix this is issue is to use an extension like maven-deployer-extension instead of using deployAtEnd/installAtEnd...