You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sj...@apache.org on 2023/01/27 21:52:15 UTC

[maven-invoker-plugin] 01/01: [MINVOKER-319] Workaround to allow use with Maven 4.0.0-alpha-4

This is an automated email from the ASF dual-hosted git repository.

sjaranowski pushed a commit to branch MINVOKER-319
in repository https://gitbox.apache.org/repos/asf/maven-invoker-plugin.git

commit 135253bb12f4a31d6fcd471b8da784be74ee83f6
Author: Slawomir Jaranowski <s....@gmail.com>
AuthorDate: Fri Jan 27 22:52:01 2023 +0100

    [MINVOKER-319] Workaround to allow use with Maven 4.0.0-alpha-4
    
    InstallMojo should be refactored according to MINVOKER-313
---
 src/main/java/org/apache/maven/plugins/invoker/InstallMojo.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/maven/plugins/invoker/InstallMojo.java b/src/main/java/org/apache/maven/plugins/invoker/InstallMojo.java
index af82d45..1bbd4eb 100644
--- a/src/main/java/org/apache/maven/plugins/invoker/InstallMojo.java
+++ b/src/main/java/org/apache/maven/plugins/invoker/InstallMojo.java
@@ -254,7 +254,9 @@ public class InstallMojo extends AbstractMojo {
             }
 
             if (installedArtifacts.add(artifact.getId())) {
-                artifact.setFile(file);
+                if (!file.equals(artifact.getFile())) {
+                    artifact.setFile(file);
+                }
                 installer.install(projectBuildingRequest, localRepositoryPath, Collections.singletonList(artifact));
             } else {
                 getLog().debug("Not re-installing " + artifact + ", " + file);