[ 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