incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r543700 - in /incubator/nmaven/trunk/plugins/maven-repository-plugin: pom.xml src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryAssemblerMojo.java
Date Sat, 02 Jun 2007 03:30:40 GMT
Author: sisbell
Date: Fri Jun  1 20:30:40 2007
New Revision: 543700

URL: http://svn.apache.org/viewvc?view=rev&rev=543700
Log:
gz.zip the repo.

Modified:
    incubator/nmaven/trunk/plugins/maven-repository-plugin/pom.xml
    incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryAssemblerMojo.java

Modified: incubator/nmaven/trunk/plugins/maven-repository-plugin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-repository-plugin/pom.xml?view=diff&rev=543700&r1=543699&r2=543700
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-repository-plugin/pom.xml (original)
+++ incubator/nmaven/trunk/plugins/maven-repository-plugin/pom.xml Fri Jun  1 20:30:40 2007
@@ -22,7 +22,7 @@
     <groupId>org.apache.maven.dotnet.plugins</groupId>
     <version>0.14-SNAPSHOT</version>
     <artifactId>maven-dotnet-plugins</artifactId>
-  </parent>  
+  </parent>
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.apache.maven.dotnet.plugins</groupId>
   <artifactId>maven-repository-plugin</artifactId>
@@ -31,4 +31,11 @@
   <description>
     Maven Plugin for .NET
   </description>
+  <dependencies>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-archiver</artifactId>
+      <version>1.0-alpha-3</version>
+    </dependency>
+  </dependencies>
 </project>

Modified: incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryAssemblerMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryAssemblerMojo.java?view=diff&rev=543700&r1=543699&r2=543700
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryAssemblerMojo.java
(original)
+++ incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryAssemblerMojo.java
Fri Jun  1 20:30:40 2007
@@ -28,6 +28,8 @@
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import org.codehaus.plexus.archiver.tar.TarArchiver;
+import org.codehaus.plexus.archiver.ArchiverException;
 
 import java.util.Set;
 import java.util.List;
@@ -137,7 +139,8 @@
         ArtifactRepository localArtifactRepository =
             new DefaultArtifactRepository( "local", "file://" + localRepository, layout );
         ArtifactRepository deploymentRepository = repositoryFactory.createDeploymentArtifactRepository(
null,
-                                                                                        
               "file://" + project.getBuild().getDirectory() +
+                                                                                        
               "file://" +
+                                                                                        
                   project.getBuild().getDirectory() +
                                                                                         
                   "/archive-temp/releases",
                                                                                         
               new DefaultRepositoryLayout(),
                                                                                         
               true );
@@ -184,6 +187,34 @@
             {
                 throw new MojoExecutionException( "NMAVEN-DEPLOY: Deploy Failed", e );
             }
+        }
+
+        TarArchiver tarArchiver = new TarArchiver();
+        try
+        {
+            tarArchiver.addDirectory( new File( project.getBuild().getDirectory(), "/archive-temp/releases"
) );
+        }
+        catch ( ArchiverException e )
+        {
+            throw new MojoExecutionException( "", e );
+        }
+
+        TarArchiver.TarCompressionMethod tarCompressionMethod = new TarArchiver.TarCompressionMethod();
+        tarArchiver.setDestFile( new File( project.getBuild().getDirectory(), project.getArtifactId()
+ ".tar.gz" ) );
+        try
+        {
+            tarCompressionMethod.setValue( "gzip" );
+            tarArchiver.setCompression( tarCompressionMethod );
+            tarArchiver.setIncludeEmptyDirs( false );
+            tarArchiver.createArchive();
+        }
+        catch ( ArchiverException e )
+        {
+            throw new MojoExecutionException( "", e );
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException( "", e );
         }
     }
 



Mime
View raw message