You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by sp...@apache.org on 2006/03/02 04:07:13 UTC

svn commit: r382256 - in /geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools: DownloadMojo.java InstallPluginDependenciesMojo.java

Author: sppatel
Date: Wed Mar  1 19:07:10 2006
New Revision: 382256

URL: http://svn.apache.org/viewcvs?rev=382256&view=rev
Log:
support for extracting gz distros

Modified:
    geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/DownloadMojo.java
    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/DownloadMojo.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/DownloadMojo.java?rev=382256&r1=382255&r2=382256&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/DownloadMojo.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/DownloadMojo.java Wed Mar  1 19:07:10 2006
@@ -21,10 +21,9 @@
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugin.install.InstallFileMojo;
-import org.apache.maven.project.MavenProject;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.taskdefs.Expand;
+import org.apache.tools.ant.taskdefs.GUnzip;
 import org.apache.tools.ant.taskdefs.Get;
 import org.apache.tools.ant.taskdefs.Untar;
 
@@ -39,12 +38,6 @@
 			+ "distributions/";
 
 	/**
-	 * @parameter expression="${project}"
-	 * @required
-	 */
-	private MavenProject project;
-
-	/**
 	 * @parameter expression="${settings.localRepository}"
 	 */
 	private String localRepoLoc;
@@ -115,8 +108,28 @@
 	}
 
 	private void install(File file) {
+
+		if (file.getName().endsWith("tar.gz")) {
+			String path = file.getAbsolutePath();
+			File tarDist = new File(path.substring(0, path.indexOf(".gz")));
+			if (!tarDist.exists()) {
+				GUnzip task = new GUnzip();
+				task.setProject(new Project());
+				task.setSrc(file);
+				task.setDest(file.getParentFile());
+				task.execute();
+			}
+			file = tarDist;
+		}
+
+		Expand expandTask = null;
 		if (file.getName().endsWith(".zip")) {
-			Expand expandTask = new Expand();
+			expandTask = new Expand();
+		} else if (file.getName().endsWith("tar")) {
+			expandTask = new Untar();
+		}
+		
+		if (expandTask != null) {
 			expandTask.setProject(new Project());
 			expandTask.setSrc(file);
 			expandTask.setDest(installDir);

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=382256&r1=382255&r2=382256&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 Wed Mar  1 19:07:10 2006
@@ -31,8 +31,6 @@
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.project.MavenProject;
 
-import sun.security.action.GetLongAction;
-
 /**
  * @goal install
  */