Author: fgiust
Date: Tue Apr  4 09:25:08 2006
New Revision: 391359

URL: http://svn.apache.org/viewcvs?rev=391359&view=rev
Log:
MECLIPSE-96 Missing support for range of dependency versions

Added:
    maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-13/
    
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-13/classpath
    
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-13/pom.xml   
(with props)
    
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-13/project
Modified:
    
maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/AbstractIdeSupportMojo.java
    
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java
    maven/plugins/trunk/maven-eclipse-plugin/src/test/m2repo/junit/junit/   
(props changed)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/m2repo/maven/maven-core/  
 (props changed)

Modified: 
maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/AbstractIdeSupportMojo.java
URL: 
http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/AbstractIdeSupportMojo.java?rev=391359&r1=391358&r2=391359&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/AbstractIdeSupportMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/AbstractIdeSupportMojo.java
 Tue Apr  4 09:25:08 2006
@@ -501,8 +501,10 @@
      * Returns the list of project artifacts. Also artifacts generated from 
referenced projects will be added, but with
      * the <code>resolved</code> property set to true.
      * @return list of projects artifacts
+     * @throws MojoExecutionException if unable to parse dependency versions
      */
     private Set getProjectArtifacts()
+        throws MojoExecutionException
     {
         // keep it sorted, this should avoid random classpath order in tests
         Set artifacts = new TreeSet();
@@ -513,7 +515,20 @@
 
             String groupId = dependency.getGroupId();
             String artifactId = dependency.getArtifactId();
-            VersionRange versionRange = VersionRange.createFromVersion( 
dependency.getVersion() );
+            VersionRange versionRange;
+            try
+            {
+                versionRange = VersionRange.createFromVersionSpec( 
dependency.getVersion() );
+            }
+            catch ( InvalidVersionSpecificationException e )
+            {
+                throw new MojoExecutionException( Messages.getString( 
"unabletoparseversion", new Object[] { //$NON-NLS-1$
+                                                                          
dependency.getArtifactId(),
+                                                                          
dependency.getVersion(),
+                                                                          
dependency.getManagementKey(),
+                                                                          
e.getMessage() } ), e );
+            }
+
             String type = dependency.getType();
             if ( type == null )
             {

Modified: 
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java
URL: 
http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java?rev=391359&r1=391358&r2=391359&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java
 (original)
+++ 
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java
 Tue Apr  4 09:25:08 2006
@@ -96,7 +96,7 @@
     }
 
     /**
-     * Test with ear project
+     * Ear packaging
      * @throws Exception any exception thrown during test
      */
     public void testProject12()
@@ -105,4 +105,13 @@
         testProject( "project-12" );
     }
 
+    /**
+     * Dependency range - MECLIPSE-96
+     * @throws Exception any exception thrown during test
+     */
+    public void testProject13()
+        throws Exception
+    {
+        testProject( "project-13" );
+    }
 }

Propchange: 
maven/plugins/trunk/maven-eclipse-plugin/src/test/m2repo/junit/junit/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Apr  4 09:25:08 2006
@@ -1 +1,3 @@
 3.8.1
+maven-metadata-central.xml
+maven-metadata-central.xml.sha1

Propchange: 
maven/plugins/trunk/maven-eclipse-plugin/src/test/m2repo/maven/maven-core/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr  4 09:25:08 2006
@@ -0,0 +1 @@
+maven-metadata-central.xml

Added: 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-13/classpath
URL: 
http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-13/classpath?rev=391359&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-13/classpath 
(added)
+++ 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-13/classpath 
Tue Apr  4 09:25:08 2006
@@ -0,0 +1,5 @@
+<classpath>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
+</classpath>
\ No newline at end of file

Added: 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-13/pom.xml
URL: 
http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-13/pom.xml?rev=391359&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-13/pom.xml 
(added)
+++ 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-13/pom.xml 
Tue Apr  4 09:25:08 2006
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>eclipse</groupId>
+  <artifactId>maven-eclipse-plugin-test-project-13</artifactId>
+  <version>13</version>
+  <packaging>jar</packaging>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>[3.0,3.8.1]</version>
+    </dependency>
+  </dependencies>
+</project>

Propchange: 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-13/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-13/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-13/project
URL: 
http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-13/project?rev=391359&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-13/project 
(added)
+++ 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-13/project 
Tue Apr  4 09:25:08 2006
@@ -0,0 +1,14 @@
+<projectDescription>
+  <name>maven-eclipse-plugin-test-project-13</name>
+  <comment/>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+      <arguments/>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file


Reply via email to