geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r383636 - in /geronimo/devtools/eclipse-plugin/trunk: maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/InstallPluginDependenciesMojo.java pom.xml
Date Mon, 06 Mar 2006 19:45:51 GMT
Author: sppatel
Date: Mon Mar  6 11:45:49 2006
New Revision: 383636

URL: http://svn.apache.org/viewcvs?rev=383636&view=rev
Log:
support installing plugins as snapshots or qualified versions

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

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=383636&r1=383635&r2=383636&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
Mon Mar  6 11:45:49 2006
@@ -32,6 +32,12 @@
 import org.apache.maven.project.MavenProject;
 
 /**
+ * This maven plugin installs to the local maven repository the eclipse plugin
+ * dependencies for a pom from an eclipse distribution. Since the eclipse jars
+ * do not follow a maven-style versioning convention the versionType parameter
+ * allows the plugin to be configured to determine the versioning style when
+ * installing. See the INSTALL_TYPE_X descriptions.
+ * 
  * @goal install
  */
 public class InstallPluginDependenciesMojo extends AbstractMojo {
@@ -39,6 +45,30 @@
 	private static final String GROUP_ID = "org.eclipse.plugins";
 
 	/**
+	 * Install type option which would install a plugin
+	 * org.eclipse.core.runtime_3.2.0.v20060216.jar as
+	 * org.eclipse.core.runtime-SNAPSHOT.jar
+	 */
+	public static final String INSTALL_TYPE_SNAPSHOT = "SNAPSHOT";
+
+	/**
+	 * Install type option which would install a plugin
+	 * org.eclipse.core.runtime_3.2.0.v20060216.jar as
+	 * org.eclipse.core.runtime-3.2.0-SNAPSHOT.jar
+	 */
+	public static final String INSTALL_TYPE_SNAPSHOT_VERSIONED = "SNAPSHOT-VERSIONED";
+
+	/**
+	 * TODO Need to investigate how the qualifier needs to be tweaked to so that maven can
+	 * do version comparisons on the artifact.
+	 * 
+	 * Install type option which would install a plugin
+	 * org.eclipse.core.runtime_3.2.0.v20060216.jar as
+	 * org.eclipse.core.runtime-3.2.0.v20060216.jar
+	 */
+	public static final String INSTALL_TYPE_QUALIFIED = "QUALIFIED";
+
+	/**
 	 * @parameter expression="${project}"
 	 */
 	private MavenProject project;
@@ -69,6 +99,11 @@
 	 */
 	protected ArtifactRepository localRepository;
 
+	/**
+	 * @parameter expression="SNAPSHOT"
+	 */
+	protected String versionType;
+
 	public InstallPluginDependenciesMojo() {
 		super();
 	}
@@ -96,7 +131,7 @@
 		while (i.hasNext()) {
 			Dependency dependency = (Dependency) i.next();
 			if (GROUP_ID.equals(dependency.getGroupId())) {
-				getLog().info("Eclipse dependency: " + dependency.toString());
+				getLog().debug("Eclipse dependency: " + dependency.toString());
 				process(pluginsDir, 0, dependency);
 			}
 		}
@@ -127,21 +162,30 @@
 		if (!file.getName().endsWith(".jar"))
 			return false;
 		return dependency == null
-				|| (getBundleName(file).equals(dependency.getArtifactId()) && getBundleVersion(file).equals(dependency.getVersion()));
+				|| (getBundleName(file).equals(dependency.getArtifactId()));
 	}
 
 	protected void install(File file, int depth) {
-		String artifactId;
-		String version;
-		if (depth > 1) {
-			File bundleDir = getBundleDir(file, depth);
-			artifactId = getBundleName(bundleDir) + "." + getArtifactID(file);
-			version = getBundleVersion(bundleDir);
-		} else {
-			artifactId = getBundleName(file);
-			version = getBundleVersion(file);
+		File bundle = file;
+		boolean isBundleJar = depth > 1 ? false : true;
+
+		if (!isBundleJar)
+			bundle = getBundleDir(file, depth);
+
+		String artifactId = getBundleName(bundle);
+		String version = "SNAPSHOT";
+
+		if (INSTALL_TYPE_QUALIFIED.equalsIgnoreCase(versionType)) {
+			version = getBundleVersion(bundle);
+		} else if (INSTALL_TYPE_SNAPSHOT_VERSIONED.equalsIgnoreCase(versionType)) {
+			version = getBundleVersion(bundle);
+			version = version.split("[0-9].[0-9].[0-9]")[0];
+			version = version + "-SNAPSHOT";
 		}
 
+		if (!isBundleJar)
+			artifactId = artifactId + "." + getArtifactID(file);
+
 		try {
 			doIt(file, GROUP_ID, artifactId, version, "jar");
 		} catch (MojoExecutionException e) {
@@ -189,7 +233,7 @@
 			File destination = new File(localRepository.getBasedir(), localPath);
 
 			if (destination.exists()) {
-				getLog().info(artifactId + " " + version
+				getLog().info(artifactId + " : " + version
 						+ " already exists in local repository.");
 				return;
 			}

Modified: geronimo/devtools/eclipse-plugin/trunk/pom.xml
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/pom.xml?rev=383636&r1=383635&r2=383636&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/pom.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/pom.xml Mon Mar  6 11:45:49 2006
@@ -117,49 +117,49 @@
     <xbean_version>2.0.0</xbean_version>
     <stax-api_version>1.0</stax-api_version>
     <!-- Eclipse Plugin Dependencies -->
-    <org.eclipse.osgi_version></org.eclipse.osgi_version>
-    <org.eclipse.debug.core_version></org.eclipse.debug.core_version>
-    <org.eclipse.jdt.launching_version></org.eclipse.jdt.launching_version>
-    <org.eclipse.core.runtime_version></org.eclipse.core.runtime_version>
-    <org.eclipse.core.resources_version></org.eclipse.core.resources_version>
-    <org.eclipse.debug.core_version></org.eclipse.debug.core_version>
-    <org.eclipse.jdt.core_version></org.eclipse.jdt.core_version>
-    <org.eclipse.jdt.launching_version></org.eclipse.jdt.launching_version>
-    <org.eclipse.wst.server.core_version></org.eclipse.wst.server.core_version>
-    <org.eclipse.jst.server.core_version></org.eclipse.jst.server.core_version>
-    <org.eclipse.emf.ecore_version></org.eclipse.emf.ecore_version>
-    <org.eclipse.emf.ecore.edit_version></org.eclipse.emf.ecore.edit_version>
-    <org.eclipse.emf.edit_version></org.eclipse.emf.edit_version>
-    <org.eclipse.emf.ecore.xmi_version></org.eclipse.emf.ecore.xmi_version>
-    <org.eclipse.emf.common_version></org.eclipse.emf.common_version>
-    <org.eclipse.core.commands_version></org.eclipse.core.commands_version>
-    <org.eclipse.jst.j2ee.web_version></org.eclipse.jst.j2ee.web_version>
-    <org.eclipse.jst.j2ee.ejb_version></org.eclipse.jst.j2ee.ejb_version>
-    <org.eclipse.jst.j2ee.jca_version></org.eclipse.jst.j2ee.jca_version>
-    <org.eclipse.jst.j2ee_version></org.eclipse.jst.j2ee_version>
-    <org.eclipse.wst.web_version></org.eclipse.wst.web_version>
-    <org.eclipse.wst.common.modulecore_version></org.eclipse.wst.common.modulecore_version>
-    <org.eclipse.jst.common.frameworks_version></org.eclipse.jst.common.frameworks_version>
-    <org.eclipse.wst.common.project.facet.core_version></org.eclipse.wst.common.project.facet.core_version>
-    <org.eclipse.jst.server.generic.core_version></org.eclipse.jst.server.generic.core_version>
-    <org.eclipse.jst.server.core_version></org.eclipse.jst.server.core_version>
-    <org.eclipse.jst.j2ee.core_version></org.eclipse.jst.j2ee.core_version>
-    <org.eclipse.wst.common.frameworks_version></org.eclipse.wst.common.frameworks_version>
+    <org.eclipse.osgi_version>SNAPSHOT</org.eclipse.osgi_version>
+    <org.eclipse.debug.core_version>SNAPSHOT</org.eclipse.debug.core_version>
+    <org.eclipse.jdt.launching_version>SNAPSHOT</org.eclipse.jdt.launching_version>
+    <org.eclipse.core.runtime_version>SNAPSHOT</org.eclipse.core.runtime_version>
+    <org.eclipse.core.resources_version>SNAPSHOT</org.eclipse.core.resources_version>
+    <org.eclipse.debug.core_version>SNAPSHOT</org.eclipse.debug.core_version>
+    <org.eclipse.jdt.core_version>SNAPSHOT</org.eclipse.jdt.core_version>
+    <org.eclipse.jdt.launching_version>SNAPSHOT</org.eclipse.jdt.launching_version>
+    <org.eclipse.wst.server.core_version>SNAPSHOT</org.eclipse.wst.server.core_version>
+    <org.eclipse.jst.server.core_version>SNAPSHOT</org.eclipse.jst.server.core_version>
+    <org.eclipse.emf.ecore_version>SNAPSHOT</org.eclipse.emf.ecore_version>
+    <org.eclipse.emf.ecore.edit_version>SNAPSHOT</org.eclipse.emf.ecore.edit_version>
+    <org.eclipse.emf.edit_version>SNAPSHOT</org.eclipse.emf.edit_version>
+    <org.eclipse.emf.ecore.xmi_version>SNAPSHOT</org.eclipse.emf.ecore.xmi_version>
+    <org.eclipse.emf.common_version>SNAPSHOT</org.eclipse.emf.common_version>
+    <org.eclipse.core.commands_version>SNAPSHOT</org.eclipse.core.commands_version>
+    <org.eclipse.jst.j2ee.web_version>SNAPSHOT</org.eclipse.jst.j2ee.web_version>
+    <org.eclipse.jst.j2ee.ejb_version>SNAPSHOT</org.eclipse.jst.j2ee.ejb_version>
+    <org.eclipse.jst.j2ee.jca_version>SNAPSHOT</org.eclipse.jst.j2ee.jca_version>
+    <org.eclipse.jst.j2ee_version>SNAPSHOT</org.eclipse.jst.j2ee_version>
+    <org.eclipse.wst.web_version>SNAPSHOT</org.eclipse.wst.web_version>
+    <org.eclipse.wst.common.modulecore_version>SNAPSHOT</org.eclipse.wst.common.modulecore_version>
+    <org.eclipse.jst.common.frameworks_version>SNAPSHOT</org.eclipse.jst.common.frameworks_version>
+    <org.eclipse.wst.common.project.facet.core_version>SNAPSHOT</org.eclipse.wst.common.project.facet.core_version>
+    <org.eclipse.jst.server.generic.core_version>SNAPSHOT</org.eclipse.jst.server.generic.core_version>
+    <org.eclipse.jst.server.core_version>SNAPSHOT</org.eclipse.jst.server.core_version>
+    <org.eclipse.jst.j2ee.core_version>SNAPSHOT</org.eclipse.jst.j2ee.core_version>
+    <org.eclipse.wst.common.frameworks_version>SNAPSHOT</org.eclipse.wst.common.frameworks_version>
     <!-- Non packaged jar bundles -->
-    <org.eclipse.jem.util.util_version></org.eclipse.jem.util.util_version>
+    <org.eclipse.jem.util.util_version>SNAPSHOT</org.eclipse.jem.util.util_version>
     <!-- UI Dependencies -->
-    <org.eclipse.ui_version></org.eclipse.ui_version>
-    <org.eclipse.ui.browser_version></org.eclipse.ui.browser_version>
-    <org.eclipse.ui.editors_version></org.eclipse.ui.editors_version>
-    <org.eclipse.ui.forms_version></org.eclipse.ui.forms_version>
-    <org.eclipse.ui.ide_version></org.eclipse.ui.ide_version>
-    <org.eclipse.ui.workbench_version></org.eclipse.ui.workbench_version>
-    <org.eclipse.ui.workbench.texteditor_version></org.eclipse.ui.workbench.texteditor_version>
-    <org.eclipse.wst.server.ui_version></org.eclipse.wst.server.ui_version>
-    <org.eclipse.jface_version></org.eclipse.jface_version>
-    <org.eclipse.jst.server.generic.ui_version></org.eclipse.jst.server.generic.ui_version>
-    <org.eclipse.swt.fragment_version></org.eclipse.swt.fragment_version>
-    <org.eclipse.emf.edit.ui_version></org.eclipse.emf.edit.ui_version>
+    <org.eclipse.ui_version>SNAPSHOT</org.eclipse.ui_version>
+    <org.eclipse.ui.browser_version>SNAPSHOT</org.eclipse.ui.browser_version>
+    <org.eclipse.ui.editors_version>SNAPSHOT</org.eclipse.ui.editors_version>
+    <org.eclipse.ui.forms_version>SNAPSHOT</org.eclipse.ui.forms_version>
+    <org.eclipse.ui.ide_version>SNAPSHOT</org.eclipse.ui.ide_version>
+    <org.eclipse.ui.workbench_version>SNAPSHOT</org.eclipse.ui.workbench_version>
+    <org.eclipse.ui.workbench.texteditor_version>SNAPSHOT</org.eclipse.ui.workbench.texteditor_version>
+    <org.eclipse.wst.server.ui_version>SNAPSHOT</org.eclipse.wst.server.ui_version>
+    <org.eclipse.jface_version>SNAPSHOT</org.eclipse.jface_version>
+    <org.eclipse.jst.server.generic.ui_version>SNAPSHOT</org.eclipse.jst.server.generic.ui_version>
+    <org.eclipse.swt.fragment_version>SNAPSHOT</org.eclipse.swt.fragment_version>
+    <org.eclipse.emf.edit.ui_version>SNAPSHOT</org.eclipse.emf.edit.ui_version>
    </properties>
 
   <dependencies>
@@ -206,6 +206,7 @@
             <url>http://download.eclipse.org/tools/emf/downloads/drops/2.1.2/R200601191349/emf-sdo-xsd-SDK-2.1.2.zip</url>
           </urls>
           <eclipsehome>${settings.localRepository}/eclipse/eclipse/</eclipsehome>
+          <versionType>snapshot</versionType>
         </configuration>
         <executions>
           <execution>
@@ -254,9 +255,9 @@
     <module>plugins/org.apache.geronimo.jetty.j2ee.server.v1</module>
     <module>plugins/org.apache.geronimo.tomcat.j2ee.server.v1</module>
     <module>plugins/org.apache.geronimo.ui</module>
-    <module>features/org.apache.geronimo.feature</module>
+    <!--<module>features/org.apache.geronimo.feature</module>
     <module>features/org.apache.geronimo.installableruntime.j2ee.feature</module>
-    <module>features/org.apache.geronimo.installableruntime.tomcat.feature</module>
+    <module>features/org.apache.geronimo.installableruntime.tomcat.feature</module>-->
   </modules>
   
 </project>



Mime
View raw message