hboutemy commented on code in PR #15:
URL: 
https://github.com/apache/maven-install-plugin/pull/15#discussion_r912438259


##########
src/main/java/org/apache/maven/plugins/install/InstallMojo.java:
##########
@@ -88,56 +77,88 @@
     @Component
     private ProjectInstaller installer;
 
+    private enum State
+    {
+        SKIPPED, INSTALLED, TO_BE_INSTALLED
+    }
+
+    private static final String INSTALL_PROCESSED_MARKER = 
InstallMojo.class.getName() + ".processed";
+
+    private void putState( State state )
+    {
+        getPluginContext().put( INSTALL_PROCESSED_MARKER, state.name() );

Review Comment:
   good question
   because Mojo API has a direct `getPluginContext()` method to get the plugin 
context for the current project
   but getting the plugin context for another project in the reactor is a 
different API that is provided in MavenSession: `MavenSession.getPluginContext( 
PluginDescriptor, MavenProject )`



##########
src/main/java/org/apache/maven/plugins/install/InstallMojo.java:
##########
@@ -94,50 +89,70 @@ public void execute()
         boolean addedInstallRequest = false;
         if ( skip )
         {
+            getPluginContext().put( INSTALL_PROCESSED_MARKER, Boolean.FALSE );
             getLog().info( "Skipping artifact installation" );
         }
         else
         {
-            // CHECKSTYLE_OFF: LineLength
-            ProjectInstallerRequest projectInstallerRequest =
-                new ProjectInstallerRequest().setProject( project );
-            // CHECKSTYLE_ON: LineLength
-
             if ( !installAtEnd )
             {
-                installProject( session.getProjectBuildingRequest(), 
projectInstallerRequest );
+                installProject( project );
             }
             else
             {
-                INSTALLREQUESTS.add( projectInstallerRequest );
+                getPluginContext().put( INSTALL_PROCESSED_MARKER, Boolean.TRUE 
);
                 addedInstallRequest = true;
             }
         }
 
-        boolean projectsReady = READYPROJECTSCOUNTER.incrementAndGet() == 
reactorProjects.size();
-        if ( projectsReady )
+        if ( allProjectsMarked() )

Review Comment:
   > if the last project being built does not have a standard lifecycle ?
   
   is this a pure theoretical question (legit when thinking, but...)? Or do you 
know any concrete case?
   
   IMHO, the best we can do is to add a note in plugins' parameter documentation



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to