olamy commented on a change in pull request #5: [MDEPLOY-206] Support parallel
deploy at end
URL: https://github.com/apache/maven-deploy-plugin/pull/5#discussion_r250937732
##########
File path: src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
##########
@@ -170,12 +183,71 @@ public void execute()
{
synchronized ( DEPLOYREQUESTS )
{
- while ( !DEPLOYREQUESTS.isEmpty() )
+ int requests = DEPLOYREQUESTS.size();
+ CompletionService<String> service = null;
+ if ( threads > 1 )
{
- ArtifactRepository repo = getDeploymentRepository(
DEPLOYREQUESTS.get( 0 ) );
+ service = new ExecutorCompletionService( new
ScheduledThreadPoolExecutor( threads ) );
+ getLog().info( "Deploying with " + threads + " threads" );
+ }
- deployProject( getSession().getProjectBuildingRequest(),
DEPLOYREQUESTS.remove( 0 ), repo );
+ for ( final ProjectDeployerRequest projectDeployerRequest :
DEPLOYREQUESTS )
+ {
+ Callable<String> callable = new Callable<String>()
+ {
+ @Override
+ public String call() throws Exception
+ {
+ ArtifactRepository repo = getDeploymentRepository(
projectDeployerRequest );
+ deployProject(
getSession().getProjectBuildingRequest(), projectDeployerRequest, repo );
+ return
projectDeployerRequest.getProject().getName();
+ }
+ };
+
+ if ( threads > 1 )
+ {
+ getLog().info( "Submitting " +
projectDeployerRequest.getProject().getName() );
+ service.submit( callable );
+ }
+ else
Review comment:
please no dependency on guava....
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services