From scm-return-10739-apmail-geronimo-scm-archive=geronimo.apache.org@geronimo.apache.org Mon Mar 06 19:46:15 2006 Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 20918 invoked from network); 6 Mar 2006 19:46:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Mar 2006 19:46:14 -0000 Received: (qmail 60117 invoked by uid 500); 6 Mar 2006 19:46:14 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 60089 invoked by uid 500); 6 Mar 2006 19:46:13 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 60072 invoked by uid 99); 6 Mar 2006 19:46:13 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Mar 2006 11:46:13 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 06 Mar 2006 11:46:12 -0800 Received: (qmail 20763 invoked by uid 65534); 6 Mar 2006 19:45:52 -0000 Message-ID: <20060306194552.20762.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: scm@geronimo.apache.org From: sppatel@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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 @@ 2.0.0 1.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT - + SNAPSHOT - - - - - - - - - - - - + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT + SNAPSHOT @@ -206,6 +206,7 @@ http://download.eclipse.org/tools/emf/downloads/drops/2.1.2/R200601191349/emf-sdo-xsd-SDK-2.1.2.zip ${settings.localRepository}/eclipse/eclipse/ + snapshot @@ -254,9 +255,9 @@ plugins/org.apache.geronimo.jetty.j2ee.server.v1 plugins/org.apache.geronimo.tomcat.j2ee.server.v1 plugins/org.apache.geronimo.ui - features/org.apache.geronimo.feature +