geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r390166 - /geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/InstallPluginDependenciesMojo.java
Date Thu, 30 Mar 2006 15:49:31 GMT
Author: sppatel
Date: Thu Mar 30 07:49:29 2006
New Revision: 390166

URL: http://svn.apache.org/viewcvs?rev=390166&view=rev
Log: (empty)

Modified:
    geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/InstallPluginDependenciesMojo.java

Modified: geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/InstallPluginDependenciesMojo.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/InstallPluginDependenciesMojo.java?rev=390166&r1=390165&r2=390166&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/InstallPluginDependenciesMojo.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/InstallPluginDependenciesMojo.java
Thu Mar 30 07:49:29 2006
@@ -149,7 +149,6 @@
 				File bundle = getBundle(file, depth);
 				if (getArtifactID(file, bundle).equals(dependency.getArtifactId())) {
 					install(file, bundle);
-					//if ("DISTRO".equals(dependency.getVersion()))
 					if(useDistributionVersion)
 						dependency.setVersion(getBundleVersion(bundle));
 				}
@@ -161,7 +160,10 @@
 
 		String artifactId = getArtifactID(artifact, bundle);
 		String version = getBundleVersion(bundle);
-
+		
+		if(!useDistributionVersion) 
+			version = fixVersion(version);
+		
 		try {
 			doIt(artifact, GROUP_ID, artifactId, version, "jar");
 		} catch (MojoExecutionException e) {
@@ -169,6 +171,24 @@
 		} catch (MojoFailureException e) {
 			e.printStackTrace();
 		}
+	}
+	
+	/**
+	 * Converts eclipse qualifier convention to maven convention.
+	 * 
+	 * major.minor.revision.qualifier is converted to major.minor.revision-build where
+	 * build is the eclipse qualifier with all non-numeric characters removed.
+	 * 
+	 * @param version
+	 * @return
+	 */
+	public static String fixVersion(String version) {
+		int qualifierIndex = version.indexOf(".", 5);
+		if(qualifierIndex == -1)  
+			return version; //has no qualifier
+		String eclipseQualifier = version.substring(qualifierIndex + 1);
+		String newQualifier = eclipseQualifier.replaceAll("[^\\d]", "");
+		return version.substring(0, qualifierIndex) + "-" + newQualifier;
 	}
 
 	protected File getBundle(File file, int depth) {



Mime
View raw message