geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r391088 - in /geronimo/devtools/eclipse-plugin/trunk: assemblies/ assemblies/g-plugin-deployable/ assemblies/updatesite-distribution/ features/org.apache.geronimo.feature/ maven-plugins/maven-emf-plugin/ maven-plugins/maven-geronimodevtools...
Date Mon, 03 Apr 2006 17:24:02 GMT
Author: sppatel
Date: Mon Apr  3 10:23:59 2006
New Revision: 391088

URL: http://svn.apache.org/viewcvs?rev=391088&view=rev
Log:
m2 packaging

Added:
    geronimo/devtools/eclipse-plugin/trunk/assemblies/
    geronimo/devtools/eclipse-plugin/trunk/assemblies/g-plugin-deployable/
    geronimo/devtools/eclipse-plugin/trunk/assemblies/g-plugin-deployable/pom.xml   (with
props)
    geronimo/devtools/eclipse-plugin/trunk/assemblies/updatesite-distribution/
    geronimo/devtools/eclipse-plugin/trunk/assemblies/updatesite-distribution/pom.xml   (with
props)
    geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/DeployableDistributionMojo.java
  (with props)
    geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/PackagingMojo.java
  (with props)
    geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/UpdateDistribtuionMojo.java
  (with props)
Modified:
    geronimo/devtools/eclipse-plugin/trunk/features/org.apache.geronimo.feature/pom.xml
    geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-emf-plugin/pom.xml
    geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/pom.xml
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.model/pom.xml

Added: geronimo/devtools/eclipse-plugin/trunk/assemblies/g-plugin-deployable/pom.xml
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/assemblies/g-plugin-deployable/pom.xml?rev=391088&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/assemblies/g-plugin-deployable/pom.xml (added)
+++ geronimo/devtools/eclipse-plugin/trunk/assemblies/g-plugin-deployable/pom.xml Mon Apr
 3 10:23:59 2006
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2006 The Apache Software Foundation
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.geronimo.devtools</groupId>
+  <artifactId>g-plugin-deployable</artifactId>
+  <packaging>zip</packaging>
+  <name>Geronimo Eclipse Plugin :: Assembly :: ${artifactId}</name>
+  <version>1.0</version>
+ <parent>
+    <groupId>org.apache.geronimo.devtools</groupId>
+    <artifactId>geronimo-eclipse-plugin</artifactId> 
+    <version>1.0</version>
+  </parent>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.geronimo.devtools</groupId>
+        <artifactId>maven-geronimodevtools-plugin</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>createdeployable</goal>
+            </goals>
+            <configuration>
+              <explodedBundles>
+                <explodedBundle>org.apache.geronimo.runtime.v1</explodedBundle>
+              </explodedBundles>
+            </configuration>
+          </execution>
+        </executions>     
+      </plugin>
+    </plugins>
+  </build>
+  
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.devtools.eclipse.core</artifactId>
+      <version>${org.apache.geronimo.devtools.eclipse.core_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.deployment.model</artifactId>
+      <version>${org.apache.geronimo.deployment.model_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.deployment.model.edit</artifactId>
+      <version>${org.apache.geronimo.deployment.model.edit_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.feature</artifactId>
+      <version>${org.apache.geronimo.feature_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.installableruntime.jetty.feature</artifactId>
+      <version>${org.apache.geronimo.installableruntime.jetty.feature_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.installableruntime.tomcat.feature</artifactId>
+      <version>${org.apache.geronimo.installableruntime.tomcat.feature_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.runtime.v1</artifactId>
+      <version>${org.apache.geronimo.runtime.v1_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.tomcat.j2ee.server.v1</artifactId>
+      <version>${org.apache.geronimo.tomcat.j2ee.server.v1_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.jetty.j2ee.server.v1</artifactId>
+      <version>${org.apache.geronimo.jetty.j2ee.server.v1_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.ui</artifactId>
+      <version>${org.apache.geronimo.ui_version}</version>
+    </dependency>
+  </dependencies>  
+</project>

Propchange: geronimo/devtools/eclipse-plugin/trunk/assemblies/g-plugin-deployable/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/assemblies/g-plugin-deployable/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/assemblies/g-plugin-deployable/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/devtools/eclipse-plugin/trunk/assemblies/updatesite-distribution/pom.xml
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/assemblies/updatesite-distribution/pom.xml?rev=391088&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/assemblies/updatesite-distribution/pom.xml (added)
+++ geronimo/devtools/eclipse-plugin/trunk/assemblies/updatesite-distribution/pom.xml Mon
Apr  3 10:23:59 2006
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2006 The Apache Software Foundation
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.geronimo.devtools</groupId>
+  <artifactId>updatesite-distribution</artifactId>
+  <packaging>jar</packaging>
+  <name>Geronimo Eclipse Plugin :: Assembly :: ${artifactId}</name>
+  <version>1.0</version>
+  <parent>
+    <groupId>org.apache.geronimo.devtools</groupId>
+    <artifactId>geronimo-eclipse-plugin</artifactId> 
+    <version>1.0</version>
+  </parent>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.geronimo.devtools</groupId>
+        <artifactId>maven-geronimodevtools-plugin</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>updatesite</goal>
+            </goals>
+          </execution>
+        </executions>     
+      </plugin>
+    </plugins>
+  </build>
+  
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.devtools.eclipse.core</artifactId>
+      <version>${org.apache.geronimo.devtools.eclipse.core_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.deployment.model</artifactId>
+      <version>${org.apache.geronimo.deployment.model_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.deployment.model.edit</artifactId>
+      <version>${org.apache.geronimo.deployment.model.edit_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.feature</artifactId>
+      <version>${org.apache.geronimo.feature_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.installableruntime.jetty.feature</artifactId>
+      <version>${org.apache.geronimo.installableruntime.jetty.feature_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.installableruntime.tomcat.feature</artifactId>
+      <version>${org.apache.geronimo.installableruntime.tomcat.feature_version}</version>
+    </dependency>-->
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.runtime.v1</artifactId>
+      <version>${org.apache.geronimo.runtime.v1_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.tomcat.j2ee.server.v1</artifactId>
+      <version>${org.apache.geronimo.tomcat.j2ee.server.v1_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.jetty.j2ee.server.v1</artifactId>
+      <version>${org.apache.geronimo.jetty.j2ee.server.v1_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.devtools</groupId>
+      <artifactId>org.apache.geronimo.ui</artifactId>
+      <version>${org.apache.geronimo.ui_version}</version>
+    </dependency>-->
+  </dependencies>
+</project>

Propchange: geronimo/devtools/eclipse-plugin/trunk/assemblies/updatesite-distribution/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/assemblies/updatesite-distribution/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/assemblies/updatesite-distribution/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: geronimo/devtools/eclipse-plugin/trunk/features/org.apache.geronimo.feature/pom.xml
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/features/org.apache.geronimo.feature/pom.xml?rev=391088&r1=391087&r2=391088&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/features/org.apache.geronimo.feature/pom.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/features/org.apache.geronimo.feature/pom.xml Mon
Apr  3 10:23:59 2006
@@ -2,7 +2,7 @@
   <modelVersion>4.0.0</modelVersion>
   <artifactId>org.apache.geronimo.feature</artifactId>
   <packaging>jar</packaging>
-  <version>${org.apache.geronimo.deployment.feature_version}</version>
+  <version>${org.apache.geronimo.feature_version}</version>
   <name>Geronio Eclipse Plugin :: Feature :: ${artifactId}</name>
   <parent>
     <groupId>org.apache.geronimo.devtools</groupId>

Modified: geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-emf-plugin/pom.xml
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-emf-plugin/pom.xml?rev=391088&r1=391087&r2=391088&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-emf-plugin/pom.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-emf-plugin/pom.xml Mon Apr
 3 10:23:59 2006
@@ -9,12 +9,12 @@
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-plugin-api</artifactId>
-      <version>2.0.2</version>
+      <version>2.0.3</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-project</artifactId>
-      <version>2.0.2</version>
+      <version>2.0.3</version>
     </dependency>
     <dependency>
       <groupId>ant</groupId>
@@ -60,12 +60,6 @@
       <id>maven1-ibiblio</id>
       <name>Maven1 Repository on iBiblio</name>
       <url>http://www.ibiblio.org/maven/</url>
-      <layout>legacy</layout>
-    </repository>
-    <repository>
-      <id>apache-cvs</id>
-      <name>Apache CVS Repository</name>
-      <url>http://people.apache.org/~sppatel/repository</url>
       <layout>legacy</layout>
     </repository>
   </repositories> 

Modified: geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/pom.xml
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/pom.xml?rev=391088&r1=391087&r2=391088&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/pom.xml
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/pom.xml
Mon Apr  3 10:23:59 2006
@@ -10,17 +10,12 @@
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-plugin-api</artifactId>
-      <version>2.0.1</version>
-    </dependency>
-    <dependency>
-      <groupId>ant</groupId>
-      <artifactId>ant</artifactId>
-      <version>1.6.5</version>
+      <version>2.0.3</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-project</artifactId>
-      <version>2.0</version>
+      <version>2.0.3</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.plugins</groupId>
@@ -28,9 +23,19 @@
       <version>2.1</version>
     </dependency>
     <dependency>
+      <groupId>ant</groupId>
+      <artifactId>ant</artifactId>
+      <version>1.6.5</version>
+    </dependency>
+    <dependency>
       <groupId>velocity</groupId>
       <artifactId>velocity</artifactId>
       <version>1.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-archiver</artifactId>
+      <version>1.0-alpha-3</version>
     </dependency>
   </dependencies>
 </project>

Added: geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/DeployableDistributionMojo.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/DeployableDistributionMojo.java?rev=391088&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/DeployableDistributionMojo.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/DeployableDistributionMojo.java
Mon Apr  3 10:23:59 2006
@@ -0,0 +1,79 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.eclipse.devtools;
+
+import java.io.File;
+import java.util.List;
+
+import org.apache.maven.artifact.Artifact;
+import org.codehaus.plexus.archiver.UnArchiver;
+import org.codehaus.plexus.archiver.manager.ArchiverManager;
+import org.codehaus.plexus.util.FileUtils;
+
+/**
+ * @goal createdeployable
+ */
+public class DeployableDistributionMojo extends PackagingMojo {
+
+	/**
+	 * @parameter
+	 */
+	private List explodedBundles;
+
+	/**
+	 * @parameter expression="${component.org.codehaus.plexus.archiver.manager.ArchiverManager}"
+	 * @required
+	 * @readonly
+	 */
+	protected ArchiverManager archiverManager;
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.eclipse.devtools.PackagingMojo#processPlugin(org.apache.maven.artifact.Artifact)
+	 */
+	void processPlugin(Artifact artifact) throws Exception {
+		if (explodedBundles.contains(artifact.getArtifactId())) {
+			UnArchiver unArchiver = archiverManager.getUnArchiver(FileUtils.getExtension(artifact.getFile().getName()));
+			unArchiver.setSourceFile(artifact.getFile());
+			unArchiver.setDestDirectory((getExpandedBundleDirectory(artifact, getPluginsDestination())));
+			unArchiver.extract();
+		} else {
+			FileUtils.copyFile(artifact.getFile(), getDestinationFile(artifact, getPluginsDestination()));
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.eclipse.devtools.PackagingMojo#processFeature(org.apache.maven.artifact.Artifact)
+	 */
+	void processFeature(Artifact artifact) throws Exception {
+		UnArchiver unArchiver = archiverManager.getUnArchiver(FileUtils.getExtension(artifact.getFile().getName()));
+		unArchiver.setSourceFile(artifact.getFile());
+		unArchiver.setDestDirectory(getExpandedBundleDirectory(artifact, getFeaturesDestination()));
+		unArchiver.extract();
+	}
+	
+	public static File getExpandedBundleDirectory(Artifact artifact, File destinationRoot) {
+		String fileName = artifact.getFile().getName().replaceFirst("-", "_");
+		String dirName = fileName.substring(0, fileName.indexOf(FileUtils.getExtension(fileName))-1);
+		File dest = new File(destinationRoot + File.separator + dirName);
+		dest.mkdirs();
+		return dest;
+	}
+
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/DeployableDistributionMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/DeployableDistributionMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/DeployableDistributionMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/PackagingMojo.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/PackagingMojo.java?rev=391088&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/PackagingMojo.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/PackagingMojo.java
Mon Apr  3 10:23:59 2006
@@ -0,0 +1,115 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.eclipse.devtools;
+
+import java.io.File;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+
+/**
+ * @requiresDependencyResolution
+ */
+public abstract class PackagingMojo extends AbstractMojo {
+	
+	/**
+	 * @parameter expression="${project}"
+	 * @required
+	 */
+	protected MavenProject project;
+
+	/**
+	 * @parameter expression="${project.dependencies}
+	 * @required
+	 * @readonly
+	 */
+	private Collection dependencies;
+
+	/** 
+	 * @parameter expression="${project.build.outputDirectory}/plugins"
+	 * @required
+	 */
+	private File pluginsDestination;
+
+	/**
+	 * @parameter expression="${project.build.outputDirectory}/features"
+	 * @required
+	 */
+	private File featuresDestination;
+
+	/* (non-Javadoc)
+	 * @see org.apache.maven.plugin.Mojo#execute()
+	 */
+	public void execute() throws MojoExecutionException, MojoFailureException {
+		Set artifacts = project.getDependencyArtifacts();
+		Iterator i = artifacts.iterator();
+		while (i.hasNext()) {
+			Artifact artifact = (Artifact) i.next();
+			if (isDirectDependency(artifact)) {
+				try {
+					URL[] urls = { artifact.getFile().toURL() };
+					URLClassLoader cl = new URLClassLoader(urls);
+					if (cl.findResource("plugin.xml") != null) {
+						processPlugin(artifact);
+					} else if (cl.findResource("feature.xml") != null) {
+						processFeature(artifact);
+					}
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+			}
+		}
+	}
+	
+	abstract void processPlugin(Artifact artifact) throws Exception;
+	
+	abstract void processFeature(Artifact artifact) throws Exception;
+	
+	protected boolean isDirectDependency(Artifact artifact) {
+		Iterator iterator = dependencies.iterator();
+		while (iterator.hasNext()) {
+			Dependency dependency = (Dependency) iterator.next();
+			if (dependency.getGroupId().equals(artifact.getGroupId())
+					&& dependency.getArtifactId().equals(artifact.getArtifactId())) {
+				return true;
+			}
+		}
+		return false;
+	}
+	
+	public static File getDestinationFile(Artifact artifact, File toDir) {
+		String fileName = artifact.getFile().getName().replaceFirst("-", "_");
+		return new File(toDir + File.separator + fileName);
+	}
+
+	public File getFeaturesDestination() {
+		return featuresDestination;
+	}
+
+	public File getPluginsDestination() {
+		return pluginsDestination;
+	}
+
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/PackagingMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/PackagingMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/PackagingMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/UpdateDistribtuionMojo.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/UpdateDistribtuionMojo.java?rev=391088&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/UpdateDistribtuionMojo.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/UpdateDistribtuionMojo.java
Mon Apr  3 10:23:59 2006
@@ -0,0 +1,43 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.eclipse.devtools;
+
+import org.apache.maven.artifact.Artifact;
+import org.codehaus.plexus.util.FileUtils;
+
+/**
+ * @goal updatesite
+ */
+public class UpdateDistribtuionMojo extends PackagingMojo {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.eclipse.devtools.PackagingMojo#processPlugin(org.apache.maven.artifact.Artifact)
+	 */
+	void processPlugin(Artifact artifact) throws Exception {
+		FileUtils.copyFile(artifact.getFile(), getDestinationFile(artifact, getPluginsDestination()));
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.eclipse.devtools.PackagingMojo#processFeature(org.apache.maven.artifact.Artifact)
+	 */
+	void processFeature(Artifact artifact) throws Exception {
+		FileUtils.copyFile(artifact.getFile(), getDestinationFile(artifact, getFeaturesDestination()));
+	}
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/UpdateDistribtuionMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/UpdateDistribtuionMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/UpdateDistribtuionMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.model/pom.xml
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.model/pom.xml?rev=391088&r1=391087&r2=391088&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.model/pom.xml
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.model/pom.xml
Mon Apr  3 10:23:59 2006
@@ -76,6 +76,7 @@
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>dependency-maven-plugin</artifactId>
+        <version>1.1-SNAPSHOT</version>
         <executions>
           <execution>
             <phase>validate</phase>



Mime
View raw message