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 2022/11/03 09:31:53 UTC

[maven-install-plugin] 01/01: Test - remove pom from metadata

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

sjaranowski pushed a commit to branch test-missing-pom
in repository https://gitbox.apache.org/repos/asf/maven-install-plugin.git

commit cc0457a499da68c8d7a349e8ca12f204801d9a9e
Author: Slawomir Jaranowski <s....@gmail.com>
AuthorDate: Thu Nov 3 10:31:28 2022 +0100

    Test - remove pom from metadata
---
 .../apache/maven/plugins/install/InstallMojo.java  | 32 ++++++++++------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/install/InstallMojo.java b/src/main/java/org/apache/maven/plugins/install/InstallMojo.java
index 5f06261..1bb46b7 100644
--- a/src/main/java/org/apache/maven/plugins/install/InstallMojo.java
+++ b/src/main/java/org/apache/maven/plugins/install/InstallMojo.java
@@ -38,12 +38,10 @@ import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.artifact.ProjectArtifact;
-import org.apache.maven.project.artifact.ProjectArtifactMetadata;
 import org.eclipse.aether.RepositorySystem;
 import org.eclipse.aether.artifact.Artifact;
 import org.eclipse.aether.installation.InstallRequest;
 import org.eclipse.aether.installation.InstallationException;
-import org.eclipse.aether.util.artifact.SubArtifact;
 
 /**
  * Installs the project's main artifact, and any other artifacts attached by other plugins in the lifecycle, to the
@@ -238,21 +236,21 @@ public class InstallMojo
                 Artifact mainArtifact = RepositoryUtils.toArtifact( mavenMainArtifact );
                 request.addArtifact( mainArtifact );
 
-                if ( !pomArtifactAttached )
-                {
-                    for ( Object metadata : mavenMainArtifact.getMetadataList() )
-                    {
-                        if ( metadata instanceof ProjectArtifactMetadata )
-                        {
-                            request.addArtifact( new SubArtifact(
-                                    mainArtifact,
-                                    "",
-                                    "pom"
-                            ).setFile( ( (ProjectArtifactMetadata) metadata ).getFile() ) );
-                            pomArtifactAttached = true;
-                        }
-                    }
-                }
+//                if ( !pomArtifactAttached )
+//                {
+//                    for ( Object metadata : mavenMainArtifact.getMetadataList() )
+//                    {
+//                        if ( metadata instanceof ProjectArtifactMetadata )
+//                        {
+//                            request.addArtifact( new SubArtifact(
+//                                    mainArtifact,
+//                                    "",
+//                                    "pom"
+//                            ).setFile( ( (ProjectArtifactMetadata) metadata ).getFile() ) );
+//                            pomArtifactAttached = true;
+//                        }
+//                    }
+//                }
             }
             else if ( !project.getAttachedArtifacts().isEmpty() )
             {