You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jim Sellers (JIRA)" <ji...@codehaus.org> on 2010/05/17 22:30:12 UTC

[jira] Created: (MECLIPSE-655) does not correctly resolve SNAPSHOTS from CI server with projects in workspace because versions do not match

does not correctly resolve SNAPSHOTS from CI server with projects in workspace because versions do not match
------------------------------------------------------------------------------------------------------------

                 Key: MECLIPSE-655
                 URL: http://jira.codehaus.org/browse/MECLIPSE-655
             Project: Maven 2.x Eclipse Plugin
          Issue Type: Bug
          Components: Core : Dependencies resolution and build path (.classpath)
    Affects Versions: 2.8
         Environment: Apache Maven 2.1.0 (r755702; 2009-03-18 15:10:27-0400)
Java version: 1.5.0_16
            Reporter: Jim Sellers
         Attachments: maven-eclipse-snapshot-issue.txt

Scenario:
1) Check out a library into your workspace, in SNAPSHOT mode.  e.g. the version is 2.0-SNAPSHOT.
2) This project is being built by a CI server, using the standard snapshot artifact naming convention.  e.g. 2.0-20100513.210009-65
3) In project in workspace that uses the library, when you run eclipse:eclipse, in the .classpath file it will link to the jar in the .m2/repository location.  In the log you'll see a message like:
[INFO] Artifact com.example:MyLibrary:jar:2.0-SNAPSHOT already available as a workspace project, but with different version. Expected: 2.0-20100513.210009-65, found: 2.0-SNAPSHOT

The weird issues:
W1) The difficult part is that if in the library you run a "mvn install" command first, and then in the other project run "mvn eclipse:eclipse", it will correctly depend on your project in the workspace.
W2) After doing W1, if the next day you re-run "mvn eclipse:eclipse" in the non-library project, it will then resolve to the artifact built in the CI server and no longer link the project to the library in the workspace.

The workaround:
Each day run "mvn install" in the library before running "mvn eclipse:eclipse" in the other project.

The solution (no patch yet, can't make it through the firewall at work):
Instead of using org.apache.maven.artifact.Artifact#getVersion(), getBaseVersion() should be used instead.

In the AbstractIdeSupportMojo#doDependencyResolution() method, near the bottom where it passing in the version, it should use the getBaseVersion()
http://maven.apache.org/plugins/maven-eclipse-plugin/xref/org/apache/maven/plugin/ide/AbstractIdeSupportMojo.html#685

In the EclipsePlugin#isAvailableAsAWorkspaceProject( Artifact artifact ) method, it should compare the "version" in the workspace to the "baseVersion"
http://maven.apache.org/plugins/maven-eclipse-plugin/xref/org/apache/maven/plugin/eclipse/EclipsePlugin.html#1941

-- 
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: (MECLIPSE-655) does not correctly resolve SNAPSHOTS from CI server with projects in workspace because versions do not match

Posted by "Jim Sellers (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=269187#action_269187 ] 

Jim Sellers commented on MECLIPSE-655:
--------------------------------------

Mark: I don't know why it's not been fixed.  Perhaps because I didn't submit a unit test?  We've been using a patched version of the eclipse plugin for a year now in order to get around this issue.  You might want to do the same.

> does not correctly resolve SNAPSHOTS from CI server with projects in workspace because versions do not match
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-655
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-655
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Dependencies resolution and build path (.classpath)
>    Affects Versions: 2.8
>         Environment: Apache Maven 2.1.0 (r755702; 2009-03-18 15:10:27-0400)
> Java version: 1.5.0_16
>            Reporter: Jim Sellers
>         Attachments: maven-eclipse-snapshot-issue.txt
>
>
> Scenario:
> 1) Check out a library into your workspace, in SNAPSHOT mode.  e.g. the version is 2.0-SNAPSHOT.
> 2) This project is being built by a CI server, using the standard snapshot artifact naming convention.  e.g. 2.0-20100513.210009-65
> 3) In project in workspace that uses the library, when you run eclipse:eclipse, in the .classpath file it will link to the jar in the .m2/repository location.  In the log you'll see a message like:
> [INFO] Artifact com.example:MyLibrary:jar:2.0-SNAPSHOT already available as a workspace project, but with different version. Expected: 2.0-20100513.210009-65, found: 2.0-SNAPSHOT
> The weird issues:
> W1) The difficult part is that if in the library you run a "mvn install" command first, and then in the other project run "mvn eclipse:eclipse", it will correctly depend on your project in the workspace.
> W2) After doing W1, if the next day you re-run "mvn eclipse:eclipse" in the non-library project, it will then resolve to the artifact built in the CI server and no longer link the project to the library in the workspace.
> The workaround:
> Each day run "mvn install" in the library before running "mvn eclipse:eclipse" in the other project.
> The solution (no patch yet, can't make it through the firewall at work):
> Instead of using org.apache.maven.artifact.Artifact#getVersion(), getBaseVersion() should be used instead.
> In the AbstractIdeSupportMojo#doDependencyResolution() method, near the bottom where it passing in the version, it should use the getBaseVersion()
> http://maven.apache.org/plugins/maven-eclipse-plugin/xref/org/apache/maven/plugin/ide/AbstractIdeSupportMojo.html#685
> In the EclipsePlugin#isAvailableAsAWorkspaceProject( Artifact artifact ) method, it should compare the "version" in the workspace to the "baseVersion"
> http://maven.apache.org/plugins/maven-eclipse-plugin/xref/org/apache/maven/plugin/eclipse/EclipsePlugin.html#1941

-- 
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: (MECLIPSE-655) does not correctly resolve SNAPSHOTS from CI server with projects in workspace because versions do not match

Posted by "Mark McEver (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=269202#action_269202 ] 

Mark McEver commented on MECLIPSE-655:
--------------------------------------

Hmmm, strange.....seems like it would affect more people.  Perhaps most people just use jar dependencies.  Thanks for the tip.

> does not correctly resolve SNAPSHOTS from CI server with projects in workspace because versions do not match
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-655
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-655
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Dependencies resolution and build path (.classpath)
>    Affects Versions: 2.8
>         Environment: Apache Maven 2.1.0 (r755702; 2009-03-18 15:10:27-0400)
> Java version: 1.5.0_16
>            Reporter: Jim Sellers
>         Attachments: maven-eclipse-snapshot-issue.txt
>
>
> Scenario:
> 1) Check out a library into your workspace, in SNAPSHOT mode.  e.g. the version is 2.0-SNAPSHOT.
> 2) This project is being built by a CI server, using the standard snapshot artifact naming convention.  e.g. 2.0-20100513.210009-65
> 3) In project in workspace that uses the library, when you run eclipse:eclipse, in the .classpath file it will link to the jar in the .m2/repository location.  In the log you'll see a message like:
> [INFO] Artifact com.example:MyLibrary:jar:2.0-SNAPSHOT already available as a workspace project, but with different version. Expected: 2.0-20100513.210009-65, found: 2.0-SNAPSHOT
> The weird issues:
> W1) The difficult part is that if in the library you run a "mvn install" command first, and then in the other project run "mvn eclipse:eclipse", it will correctly depend on your project in the workspace.
> W2) After doing W1, if the next day you re-run "mvn eclipse:eclipse" in the non-library project, it will then resolve to the artifact built in the CI server and no longer link the project to the library in the workspace.
> The workaround:
> Each day run "mvn install" in the library before running "mvn eclipse:eclipse" in the other project.
> The solution (no patch yet, can't make it through the firewall at work):
> Instead of using org.apache.maven.artifact.Artifact#getVersion(), getBaseVersion() should be used instead.
> In the AbstractIdeSupportMojo#doDependencyResolution() method, near the bottom where it passing in the version, it should use the getBaseVersion()
> http://maven.apache.org/plugins/maven-eclipse-plugin/xref/org/apache/maven/plugin/ide/AbstractIdeSupportMojo.html#685
> In the EclipsePlugin#isAvailableAsAWorkspaceProject( Artifact artifact ) method, it should compare the "version" in the workspace to the "baseVersion"
> http://maven.apache.org/plugins/maven-eclipse-plugin/xref/org/apache/maven/plugin/eclipse/EclipsePlugin.html#1941

-- 
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: (MECLIPSE-655) does not correctly resolve SNAPSHOTS from CI server with projects in workspace because versions do not match

Posted by "Jean Helou (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=269702#action_269702 ] 

Jean Helou commented on MECLIPSE-655:
-------------------------------------

I also think it's a pain, actually I would like an even more aggressive option where I could tell the plugin to automatically resolve to workspace projects if available regardless of the version altogether. Yes I know it can be dangerous, in our case it would be a blessing though.

> does not correctly resolve SNAPSHOTS from CI server with projects in workspace because versions do not match
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-655
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-655
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Dependencies resolution and build path (.classpath)
>    Affects Versions: 2.8
>         Environment: Apache Maven 2.1.0 (r755702; 2009-03-18 15:10:27-0400)
> Java version: 1.5.0_16
>            Reporter: Jim Sellers
>         Attachments: maven-eclipse-snapshot-issue.txt
>
>
> Scenario:
> 1) Check out a library into your workspace, in SNAPSHOT mode.  e.g. the version is 2.0-SNAPSHOT.
> 2) This project is being built by a CI server, using the standard snapshot artifact naming convention.  e.g. 2.0-20100513.210009-65
> 3) In project in workspace that uses the library, when you run eclipse:eclipse, in the .classpath file it will link to the jar in the .m2/repository location.  In the log you'll see a message like:
> [INFO] Artifact com.example:MyLibrary:jar:2.0-SNAPSHOT already available as a workspace project, but with different version. Expected: 2.0-20100513.210009-65, found: 2.0-SNAPSHOT
> The weird issues:
> W1) The difficult part is that if in the library you run a "mvn install" command first, and then in the other project run "mvn eclipse:eclipse", it will correctly depend on your project in the workspace.
> W2) After doing W1, if the next day you re-run "mvn eclipse:eclipse" in the non-library project, it will then resolve to the artifact built in the CI server and no longer link the project to the library in the workspace.
> The workaround:
> Each day run "mvn install" in the library before running "mvn eclipse:eclipse" in the other project.
> The solution (no patch yet, can't make it through the firewall at work):
> Instead of using org.apache.maven.artifact.Artifact#getVersion(), getBaseVersion() should be used instead.
> In the AbstractIdeSupportMojo#doDependencyResolution() method, near the bottom where it passing in the version, it should use the getBaseVersion()
> http://maven.apache.org/plugins/maven-eclipse-plugin/xref/org/apache/maven/plugin/ide/AbstractIdeSupportMojo.html#685
> In the EclipsePlugin#isAvailableAsAWorkspaceProject( Artifact artifact ) method, it should compare the "version" in the workspace to the "baseVersion"
> http://maven.apache.org/plugins/maven-eclipse-plugin/xref/org/apache/maven/plugin/eclipse/EclipsePlugin.html#1941

-- 
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: (MECLIPSE-655) does not correctly resolve SNAPSHOTS from CI server with projects in workspace because versions do not match

Posted by "Mark McEver (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=269175#action_269175 ] 

Mark McEver commented on MECLIPSE-655:
--------------------------------------

I am experiencing this as well.  Does anyone know why this hasn't been resolved yet?  Or why more people aren't experiencing this problem?

Thanks,
Mark

> does not correctly resolve SNAPSHOTS from CI server with projects in workspace because versions do not match
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-655
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-655
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Dependencies resolution and build path (.classpath)
>    Affects Versions: 2.8
>         Environment: Apache Maven 2.1.0 (r755702; 2009-03-18 15:10:27-0400)
> Java version: 1.5.0_16
>            Reporter: Jim Sellers
>         Attachments: maven-eclipse-snapshot-issue.txt
>
>
> Scenario:
> 1) Check out a library into your workspace, in SNAPSHOT mode.  e.g. the version is 2.0-SNAPSHOT.
> 2) This project is being built by a CI server, using the standard snapshot artifact naming convention.  e.g. 2.0-20100513.210009-65
> 3) In project in workspace that uses the library, when you run eclipse:eclipse, in the .classpath file it will link to the jar in the .m2/repository location.  In the log you'll see a message like:
> [INFO] Artifact com.example:MyLibrary:jar:2.0-SNAPSHOT already available as a workspace project, but with different version. Expected: 2.0-20100513.210009-65, found: 2.0-SNAPSHOT
> The weird issues:
> W1) The difficult part is that if in the library you run a "mvn install" command first, and then in the other project run "mvn eclipse:eclipse", it will correctly depend on your project in the workspace.
> W2) After doing W1, if the next day you re-run "mvn eclipse:eclipse" in the non-library project, it will then resolve to the artifact built in the CI server and no longer link the project to the library in the workspace.
> The workaround:
> Each day run "mvn install" in the library before running "mvn eclipse:eclipse" in the other project.
> The solution (no patch yet, can't make it through the firewall at work):
> Instead of using org.apache.maven.artifact.Artifact#getVersion(), getBaseVersion() should be used instead.
> In the AbstractIdeSupportMojo#doDependencyResolution() method, near the bottom where it passing in the version, it should use the getBaseVersion()
> http://maven.apache.org/plugins/maven-eclipse-plugin/xref/org/apache/maven/plugin/ide/AbstractIdeSupportMojo.html#685
> In the EclipsePlugin#isAvailableAsAWorkspaceProject( Artifact artifact ) method, it should compare the "version" in the workspace to the "baseVersion"
> http://maven.apache.org/plugins/maven-eclipse-plugin/xref/org/apache/maven/plugin/eclipse/EclipsePlugin.html#1941

-- 
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