AtEnd aggregation implementation idiom broken

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

AtEnd aggregation implementation idiom broken

Chas Honton
I've run across multiple broken plugins that follow the deployAtEnd  
implementation found in the deploy plugin.  The intent is to delay an  
action until the end of the aggregation cycle.  In the current  
implementation, there are multiple problems;
1. If one or more of the aggregated modules skip the plugin, the  
counter will never reach the number of plugins
2. If the aggregated modules have different extensions enabled, the  
different invocations will be in different ClassLoaders, therefore  
different counters will be used.

A solution is to share state in the session userProperties[1].  The  
full details are in a github pull request [2]

Please validate that this is the best imlementation of the 'atEnd'  
idiom.  If this pull request is accepted, I will write up the details  
for the Maven plugins Cookbook[3]

thanks,
chas



Links:
------
[1]  
https://github.com/apache/maven-deploy-plugin/pull/1/files#diff-c7e8b44410d1cdfab14cd04e7230f57d
[2] https://github.com/apache/maven-deploy-plugin/pull/1
[3] https://maven.apache.org/plugin-developers/cookbook/index.html