[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven » Maven TLP » maven » MNG-6169/MNG-6551 
#14

See 
https://ci-builds.apache.org/job/Maven/job/maven-box/job/maven/job/MNG-6169%252FMNG-6551/14/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build succeeded in Jenkins: Maven » Maven TLP » maven » MNG-6169/MNG-6556 
#14

See 
https://ci-builds.apache.org/job/Maven/job/maven-box/job/maven/job/MNG-6169%252FMNG-6556/14/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build succeeded in Jenkins: Maven » Maven TLP » maven » MNG-6169/MNG-6555 
#14

See 
https://ci-builds.apache.org/job/Maven/job/maven-box/job/maven/job/MNG-6169%252FMNG-6555/14/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build succeeded in Jenkins: Maven » Maven TLP » maven » MNG-6169/MNG-6553 
#14

See 
https://ci-builds.apache.org/job/Maven/job/maven-box/job/maven/job/MNG-6169%252FMNG-6553/14/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven-studies » maven-metrics #20

See 
https://builds.apache.org/job/maven-box/job/maven-studies/job/maven-metrics/20/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build failed in Jenkins: Maven TLP » maven » MPOM-215 #33

See https://builds.apache.org/job/maven-box/job/maven/job/MPOM-215/33/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build failed in Jenkins: Maven TLP » maven » slf4j-1.8-modules #34

See https://builds.apache.org/job/maven-box/job/maven/job/slf4j-1.8-modules/34/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » REMOVE_DEPRECATED #16

See https://builds.apache.org/job/maven-box/job/maven/job/REMOVE_DEPRECATED/16/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » mng-5668-poc #24

See https://builds.apache.org/job/maven-box/job/maven/job/mng-5668-poc/24/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » 
MNG-6012-Missing-Profile-At-End #57

See 
https://builds.apache.org/job/maven-box/job/maven/job/MNG-6012-Missing-Profile-At-End/57/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » MNG-6829 #24

See https://builds.apache.org/job/maven-box/job/maven/job/MNG-6829/24/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » Bananeweizen-MNG-6907 #3

See 
https://builds.apache.org/job/maven-box/job/maven/job/Bananeweizen-MNG-6907/3/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » MNG-5567 #55

See https://builds.apache.org/job/maven-box/job/maven/job/MNG-5567/55/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » MNG-6888 #3

See https://builds.apache.org/job/maven-box/job/maven/job/MNG-6888/3/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » MNG-6169/MNG-6553 #38

See 
https://builds.apache.org/job/maven-box/job/maven/job/MNG-6169%252FMNG-6553/38/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » MNG-6889 #3

See https://builds.apache.org/job/maven-box/job/maven/job/MNG-6889/3/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » MNG-6548 #22

See https://builds.apache.org/job/maven-box/job/maven/job/MNG-6548/22/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » MNG-6169/MNG-6551 #44

See 
https://builds.apache.org/job/maven-box/job/maven/job/MNG-6169%252FMNG-6551/44/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » MNG-6169/MNG-6554 #37

See 
https://builds.apache.org/job/maven-box/job/maven/job/MNG-6169%252FMNG-6554/37/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » MODELTESTS_IMPROVEMENT #26

See 
https://builds.apache.org/job/maven-box/job/maven/job/MODELTESTS_IMPROVEMENT/26/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » MNG-6169/MNG-6550 #41

See 
https://builds.apache.org/job/maven-box/job/maven/job/MNG-6169%252FMNG-6550/41/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » MRESOLVER-94 #3

See https://builds.apache.org/job/maven-box/job/maven/job/MRESOLVER-94/3/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » MNG-6169/MNG-6555 #45

See 
https://builds.apache.org/job/maven-box/job/maven/job/MNG-6169%252FMNG-6555/45/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » MNG-6512-build-11 #15

See https://builds.apache.org/job/maven-box/job/maven/job/MNG-6512-build-11/15/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build succeeded in Jenkins: Maven TLP » maven » MNG-6878 #8

See https://builds.apache.org/job/maven-box/job/maven/job/MNG-6878/8/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » MNG-6169/MNG-6552 #38

See 
https://builds.apache.org/job/maven-box/job/maven/job/MNG-6169%252FMNG-6552/38/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » MNG-6828 #15

See https://builds.apache.org/job/maven-box/job/maven/job/MNG-6828/15/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » MNG-6909 #8

See https://builds.apache.org/job/maven-box/job/maven/job/MNG-6909/8/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build succeeded in Jenkins: Maven TLP » maven » master #434

See https://builds.apache.org/job/maven-box/job/maven/job/master/434/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build failed in Jenkins: Maven TLP » maven » MNG-6656 #66

See https://builds.apache.org/job/maven-box/job/maven/job/MNG-6656/66/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build unstable in Jenkins: Maven TLP » maven » MNG-6656 #70

See https://builds.apache.org/job/maven-box/job/maven/job/MNG-6656/70/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build failed in Jenkins: Maven TLP » maven » MNG-6169/MNG-6556 #43

See 
https://builds.apache.org/job/maven-box/job/maven/job/MNG-6169%252FMNG-6556/43/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Issue Comment Deleted] (MNG-5868) Adding serval times the same artifact via MavenProjectHelper (attachArtifact) keep adding to the List duplicate artifacts

2020-12-20 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated MNG-5868:

Comment: was deleted

(was: Build failed in Jenkins: Maven TLP » maven » master #420

See https://builds.apache.org/job/maven-box/job/maven/job/master/420/)

> Adding serval times the same artifact via MavenProjectHelper (attachArtifact) 
> keep adding to the List duplicate artifacts
> -
>
> Key: MNG-5868
> URL: https://issues.apache.org/jira/browse/MNG-5868
> Project: Maven
>  Issue Type: Bug
>  Components: core
>Affects Versions: 3.2.3
>Reporter: Karl Heinz Marbaise
>Assignee: Olivier Lamy
>Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> During the check of an issue MSHADE-195 i stumbled over several things...
> If you take a look here and the log output excerpt:
> {noformat}
> INFO] Minimized 2341 -> 1293
> [INFO] Minimized 3282 -> 2234
> [INFO] Replacing original artifact with shaded artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded.jar
> [INFO] Replacing original source artifact with shaded source artifact.
> [INFO] Replacing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  with 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-shaded-sources.jar
> [INFO] Dependency-reduced POM written at: 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml
> [INFO]
> [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ 
> MSHADE-195-example ---
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/dependency-reduced-pom.xml to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT.pom
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] Installing 
> /Users/kama/ws-git/apache/mshade/mshade-195/target/MSHADE-195-example-1-SNAPSHOT-sources.jar
>  to 
> /Users/kama/.m2/repository/com/example/MSHADE-195-example/1-SNAPSHOT/MSHADE-195-example-1-SNAPSHOT-sources.jar
> [INFO] 
> {noformat}
> Install plugin tries to install two identical artifacts which will work for 
> maven-install-plugin but would fail a deploy to repository manager (for 
> releases) etc.
> So after diving into the problem i found the following code in maven-core 
> (MavenProject.java):
> {code:java}
> /**
>  * Add or replace an artifact. This method is now deprecated. Use the 
> @{MavenProjectHelper} to attach artifacts to a
>  * project. In spite of the 'throws' declaration on this API, this method 
> has never thrown an exception since Maven
>  * 3.0.x. Historically, it logged and ignored a second addition of the 
> same g/a/v/c/t. Now it replaces the file for
>  * the artifact, so that plugins (e.g. shade) can change the pathname of 
> the file for a particular set of
>  * coordinates.
>  *
>  * @param artifact the artifact to add or replace.
>  * @throws DuplicateArtifactAttachmentException
>  */
> public void addAttachedArtifact( Artifact artifact )
> throws DuplicateArtifactAttachmentException
> {
> getAttachedArtifacts().add( artifact );
> }
> public List getAttachedArtifacts()
> {
> if ( attachedArtifacts == null )
> {
> attachedArtifacts = new ArrayList<>();
> }
> return attachedArtifacts;
> }
> {code}
> So taking a look into MavenProjectHelper.java and the implementation 
> (DefaultMavenProjectHelper.java).
> {code:java}
> /**
>  * Add an attached artifact or replace the file for an existing artifact.
>  *
>  * @see 
> MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact)
>  * @param project project reference.
>  * @param artifact artifact to add or replace.
>  */
> public void attachArtifact( MavenProject project, Artifact artifact )
> {
> project.addAttachedArtifact( artifact );
> }
> {code}
> which means that there is not check if an artifacts is already attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)