You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Bud Osterberg (JIRA)" <ji...@codehaus.org> on 2006/10/27 02:34:03 UTC
[jira] Created: (MPARTIFACT-73) DefaultArtifactCollector.recurse
can lose versionRange
DefaultArtifactCollector.recurse can lose versionRange
------------------------------------------------------
Key: MPARTIFACT-73
URL: http://jira.codehaus.org/browse/MPARTIFACT-73
Project: maven-artifact-plugin
Issue Type: Bug
Environment: Linux
Reporter: Bud Osterberg
Attachments: artifact_patch
This affects maven 2.0.4 and 2.0.5 (at least).
I'm not quite sure how to reproduce the bug in a simple test case, but we have a setup where running the command:
mvn install site source:jar
crashes in ArtifactUtils.copyArtifact because artifact.getVersionRange() returns null.
The code that seems to be causing the problem is in DefaultArtifactCollector.recurse(). Because the Artifact sets the version in setVersionRange, but can't set the VersionRange from setVersion, the VersionRange should take precedence if it exists. A simple diff follows:
Index: components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java
===================================================================
--- components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java (revision 467177)
+++ components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java (working copy)
@@ -114,8 +114,13 @@
fireEvent( ResolutionListener.MANAGE_ARTIFACT, listeners, node, artifact );
- if ( artifact.getVersion() != null )
+ VersionRange range = artifact.getVersionRange();
+ if (range != null)
{
+ node.getArtifact().setVersionRange(range);
+ }
+ else if ( artifact.getVersion() != null )
+ {
node.getArtifact().setVersion( artifact.getVersion() );
}
if ( artifact.getScope() != null )
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (MNG-2635) DefaultArtifactCollector.recurse can
lose versionRange
Posted by "Jason van Zyl (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-2635?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jason van Zyl updated MNG-2635:
-------------------------------
Component/s: Artifacts and Repositories
> DefaultArtifactCollector.recurse can lose versionRange
> ------------------------------------------------------
>
> Key: MNG-2635
> URL: http://jira.codehaus.org/browse/MNG-2635
> Project: Maven 2
> Issue Type: Bug
> Components: Artifacts and Repositories
> Environment: Linux
> Reporter: Bud Osterberg
> Assignee: Jason van Zyl
> Attachments: artifact_patch
>
>
> This affects maven 2.0.4 and 2.0.5 (at least).
> I'm not quite sure how to reproduce the bug in a simple test case, but we have a setup where running the command:
> mvn install site source:jar
> crashes in ArtifactUtils.copyArtifact because artifact.getVersionRange() returns null.
> The code that seems to be causing the problem is in DefaultArtifactCollector.recurse(). Because the Artifact sets the version in setVersionRange, but can't set the VersionRange from setVersion, the VersionRange should take precedence if it exists. A simple diff follows:
> Index: components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java
> ===================================================================
> --- components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java (revision 467177)
> +++ components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java (working copy)
> @@ -114,8 +114,13 @@
>
> fireEvent( ResolutionListener.MANAGE_ARTIFACT, listeners, node, artifact );
>
> - if ( artifact.getVersion() != null )
> + VersionRange range = artifact.getVersionRange();
> + if (range != null)
> {
> + node.getArtifact().setVersionRange(range);
> + }
> + else if ( artifact.getVersion() != null )
> + {
> node.getArtifact().setVersion( artifact.getVersion() );
> }
> if ( artifact.getScope() != null )
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-2635) DefaultArtifactCollector.recurse can
lose versionRange
Posted by "Bud Osterberg (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-2635?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_126999 ]
Bud Osterberg commented on MNG-2635:
------------------------------------
This seems to work OK in 2.0.7 and 2.0.8.
> DefaultArtifactCollector.recurse can lose versionRange
> ------------------------------------------------------
>
> Key: MNG-2635
> URL: http://jira.codehaus.org/browse/MNG-2635
> Project: Maven 2
> Issue Type: Bug
> Components: Artifacts and Repositories
> Environment: Linux
> Reporter: Bud Osterberg
> Assignee: Brian Fox
> Fix For: 2.0.10
>
> Attachments: artifact_patch
>
>
> This affects maven 2.0.4 and 2.0.5 (at least).
> I'm not quite sure how to reproduce the bug in a simple test case, but we have a setup where running the command:
> mvn install site source:jar
> crashes in ArtifactUtils.copyArtifact because artifact.getVersionRange() returns null.
> The code that seems to be causing the problem is in DefaultArtifactCollector.recurse(). Because the Artifact sets the version in setVersionRange, but can't set the VersionRange from setVersion, the VersionRange should take precedence if it exists. A simple diff follows:
> Index: components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java
> ===================================================================
> --- components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java (revision 467177)
> +++ components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java (working copy)
> @@ -114,8 +114,13 @@
>
> fireEvent( ResolutionListener.MANAGE_ARTIFACT, listeners, node, artifact );
>
> - if ( artifact.getVersion() != null )
> + VersionRange range = artifact.getVersionRange();
> + if (range != null)
> {
> + node.getArtifact().setVersionRange(range);
> + }
> + else if ( artifact.getVersion() != null )
> + {
> node.getArtifact().setVersion( artifact.getVersion() );
> }
> if ( artifact.getScope() != null )
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (MNG-2635) DefaultArtifactCollector.recurse can
lose versionRange
Posted by "Jason van Zyl (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-2635?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jason van Zyl updated MNG-2635:
-------------------------------
Patch Submitted: (was: [Yes])
> DefaultArtifactCollector.recurse can lose versionRange
> ------------------------------------------------------
>
> Key: MNG-2635
> URL: http://jira.codehaus.org/browse/MNG-2635
> Project: Maven 2
> Issue Type: Bug
> Components: Artifacts and Repositories
> Environment: Linux
> Reporter: Bud Osterberg
> Assignee: Jason van Zyl
> Attachments: artifact_patch
>
>
> This affects maven 2.0.4 and 2.0.5 (at least).
> I'm not quite sure how to reproduce the bug in a simple test case, but we have a setup where running the command:
> mvn install site source:jar
> crashes in ArtifactUtils.copyArtifact because artifact.getVersionRange() returns null.
> The code that seems to be causing the problem is in DefaultArtifactCollector.recurse(). Because the Artifact sets the version in setVersionRange, but can't set the VersionRange from setVersion, the VersionRange should take precedence if it exists. A simple diff follows:
> Index: components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java
> ===================================================================
> --- components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java (revision 467177)
> +++ components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java (working copy)
> @@ -114,8 +114,13 @@
>
> fireEvent( ResolutionListener.MANAGE_ARTIFACT, listeners, node, artifact );
>
> - if ( artifact.getVersion() != null )
> + VersionRange range = artifact.getVersionRange();
> + if (range != null)
> {
> + node.getArtifact().setVersionRange(range);
> + }
> + else if ( artifact.getVersion() != null )
> + {
> node.getArtifact().setVersion( artifact.getVersion() );
> }
> if ( artifact.getScope() != null )
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Moved: (MNG-2635) DefaultArtifactCollector.recurse can lose
versionRange
Posted by "Arnaud Heritier (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-2635?page=all ]
Arnaud Heritier moved MPARTIFACT-73 to MNG-2635:
------------------------------------------------
Complexity: Intermediate
Workflow: Maven New (was: jira)
Key: MNG-2635 (was: MPARTIFACT-73)
Project: Maven 2 (was: maven-artifact-plugin)
> DefaultArtifactCollector.recurse can lose versionRange
> ------------------------------------------------------
>
> Key: MNG-2635
> URL: http://jira.codehaus.org/browse/MNG-2635
> Project: Maven 2
> Issue Type: Bug
> Environment: Linux
> Reporter: Bud Osterberg
> Attachments: artifact_patch
>
>
> This affects maven 2.0.4 and 2.0.5 (at least).
> I'm not quite sure how to reproduce the bug in a simple test case, but we have a setup where running the command:
> mvn install site source:jar
> crashes in ArtifactUtils.copyArtifact because artifact.getVersionRange() returns null.
> The code that seems to be causing the problem is in DefaultArtifactCollector.recurse(). Because the Artifact sets the version in setVersionRange, but can't set the VersionRange from setVersion, the VersionRange should take precedence if it exists. A simple diff follows:
> Index: components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java
> ===================================================================
> --- components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java (revision 467177)
> +++ components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java (working copy)
> @@ -114,8 +114,13 @@
>
> fireEvent( ResolutionListener.MANAGE_ARTIFACT, listeners, node, artifact );
>
> - if ( artifact.getVersion() != null )
> + VersionRange range = artifact.getVersionRange();
> + if (range != null)
> {
> + node.getArtifact().setVersionRange(range);
> + }
> + else if ( artifact.getVersion() != null )
> + {
> node.getArtifact().setVersion( artifact.getVersion() );
> }
> if ( artifact.getScope() != null )
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (MNG-2635) DefaultArtifactCollector.recurse can
lose versionRange
Posted by "Brian Fox (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-2635?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brian Fox updated MNG-2635:
---------------------------
Fix Version/s: (was: Reviewed Pending Version Assignment)
2.0.10
> DefaultArtifactCollector.recurse can lose versionRange
> ------------------------------------------------------
>
> Key: MNG-2635
> URL: http://jira.codehaus.org/browse/MNG-2635
> Project: Maven 2
> Issue Type: Bug
> Components: Artifacts and Repositories
> Environment: Linux
> Reporter: Bud Osterberg
> Assignee: Brian Fox
> Fix For: 2.0.10
>
> Attachments: artifact_patch
>
>
> This affects maven 2.0.4 and 2.0.5 (at least).
> I'm not quite sure how to reproduce the bug in a simple test case, but we have a setup where running the command:
> mvn install site source:jar
> crashes in ArtifactUtils.copyArtifact because artifact.getVersionRange() returns null.
> The code that seems to be causing the problem is in DefaultArtifactCollector.recurse(). Because the Artifact sets the version in setVersionRange, but can't set the VersionRange from setVersion, the VersionRange should take precedence if it exists. A simple diff follows:
> Index: components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java
> ===================================================================
> --- components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java (revision 467177)
> +++ components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java (working copy)
> @@ -114,8 +114,13 @@
>
> fireEvent( ResolutionListener.MANAGE_ARTIFACT, listeners, node, artifact );
>
> - if ( artifact.getVersion() != null )
> + VersionRange range = artifact.getVersionRange();
> + if (range != null)
> {
> + node.getArtifact().setVersionRange(range);
> + }
> + else if ( artifact.getVersion() != null )
> + {
> node.getArtifact().setVersion( artifact.getVersion() );
> }
> if ( artifact.getScope() != null )
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (MNG-2635) DefaultArtifactCollector.recurse can lose
versionRange
Posted by "Brian Fox (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-2635?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brian Fox closed MNG-2635.
--------------------------
Resolution: Fixed
Fix Version/s: (was: 2.0.10)
2.0.7
> DefaultArtifactCollector.recurse can lose versionRange
> ------------------------------------------------------
>
> Key: MNG-2635
> URL: http://jira.codehaus.org/browse/MNG-2635
> Project: Maven 2
> Issue Type: Bug
> Components: Artifacts and Repositories
> Environment: Linux
> Reporter: Bud Osterberg
> Assignee: Brian Fox
> Fix For: 2.0.7
>
> Attachments: artifact_patch
>
>
> This affects maven 2.0.4 and 2.0.5 (at least).
> I'm not quite sure how to reproduce the bug in a simple test case, but we have a setup where running the command:
> mvn install site source:jar
> crashes in ArtifactUtils.copyArtifact because artifact.getVersionRange() returns null.
> The code that seems to be causing the problem is in DefaultArtifactCollector.recurse(). Because the Artifact sets the version in setVersionRange, but can't set the VersionRange from setVersion, the VersionRange should take precedence if it exists. A simple diff follows:
> Index: components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java
> ===================================================================
> --- components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java (revision 467177)
> +++ components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java (working copy)
> @@ -114,8 +114,13 @@
>
> fireEvent( ResolutionListener.MANAGE_ARTIFACT, listeners, node, artifact );
>
> - if ( artifact.getVersion() != null )
> + VersionRange range = artifact.getVersionRange();
> + if (range != null)
> {
> + node.getArtifact().setVersionRange(range);
> + }
> + else if ( artifact.getVersion() != null )
> + {
> node.getArtifact().setVersion( artifact.getVersion() );
> }
> if ( artifact.getScope() != null )
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-2635) DefaultArtifactCollector.recurse can
lose versionRange
Posted by "Brian Fox (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-2635?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_126226 ]
Brian Fox commented on MNG-2635:
--------------------------------
Can you see if this still occurs in later versions? The code is different and without a test to validate, I don't want to just throw changes in here.
> DefaultArtifactCollector.recurse can lose versionRange
> ------------------------------------------------------
>
> Key: MNG-2635
> URL: http://jira.codehaus.org/browse/MNG-2635
> Project: Maven 2
> Issue Type: Bug
> Components: Artifacts and Repositories
> Environment: Linux
> Reporter: Bud Osterberg
> Assignee: Brian Fox
> Fix For: Reviewed Pending Version Assignment
>
> Attachments: artifact_patch
>
>
> This affects maven 2.0.4 and 2.0.5 (at least).
> I'm not quite sure how to reproduce the bug in a simple test case, but we have a setup where running the command:
> mvn install site source:jar
> crashes in ArtifactUtils.copyArtifact because artifact.getVersionRange() returns null.
> The code that seems to be causing the problem is in DefaultArtifactCollector.recurse(). Because the Artifact sets the version in setVersionRange, but can't set the VersionRange from setVersion, the VersionRange should take precedence if it exists. A simple diff follows:
> Index: components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java
> ===================================================================
> --- components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java (revision 467177)
> +++ components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java (working copy)
> @@ -114,8 +114,13 @@
>
> fireEvent( ResolutionListener.MANAGE_ARTIFACT, listeners, node, artifact );
>
> - if ( artifact.getVersion() != null )
> + VersionRange range = artifact.getVersionRange();
> + if (range != null)
> {
> + node.getArtifact().setVersionRange(range);
> + }
> + else if ( artifact.getVersion() != null )
> + {
> node.getArtifact().setVersion( artifact.getVersion() );
> }
> if ( artifact.getScope() != null )
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira