On 6/28/2010 4:12 PM, Ron Wheeler wrote:
> I am trying to build a pom in its own project that will assemble a tar
> file and a zip file that will contain all of the jar files that we
> build that need to go into the tomcat/lib directory.
>
>
> I am missing 2 things.
> 1) What do I say to tell the maven-assembly-plugin that I want a tar
> and a zip built?

There are two ways to configure the assembly plugin - one uses
"predefined" descriptors, the other lets you specify specific
instructions in a descriptor of your own that you point to - use the
parameter <descriptors> instead of <descriptorRefs>.

Then write your own assembly descriptor.  See
http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html for
instructions on how to do this.  You'll see an element <formats> where
you can specify the tar and zip formats.

> 2) How to I tell the maven-assembly-plugin that I want the jar files
> zipped up without the contents being extracted and zipped as
> individual classes?

In the custom assembly descriptor you make, you can control this using
the <unpack> option, see the details in the above documentation.

For a book chapter on how to do all kinds of things with assemblies, see:
http://www.sonatype.com/books/mvnref-book/reference/assemblies.html

-Marshall Schor

 


>
> I have built a test pom shown below.
> Since it has
> <descriptorRef>
>                                     jar-with-dependencies
> </descriptorRef>
> it restructures the internal jar contents rather than creating a tar
> of jar files.
>
> I did find a nice article from Sonatype but these questions remain.
> Ron
>
>
>
> <project xmlns="http://maven.apache.org/POM/4.0.0";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
> <modelVersion>4.0.0</modelVersion>
> <parent>
> <groupId>com.artifact_software.lms</groupId>
> <artifactId>lms-pom-master</artifactId>
> <version>1.8.3-SNAPSHOT</version>
> </parent>
>
> <groupId>com.artifact_software.lms</groupId>
> <artifactId>lms-deployment-jars</artifactId>
> <version>1.8.3-SNAPSHOT</version>
> <packaging>pom</packaging>
> <description>Artifact LMS Portal Shared Library Archive
> builder.</description>
>
> <name>lms-deploymentjars</name>
>
> <properties>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> </properties>
>
> <dependencies>
> <dependency>
> <groupId>com.artifact_software.lms</groupId>
> <artifactId>lms-pom-spring-hibernate-mysql-tomcat</artifactId>
> <version>${lms-project.version}</version>
> <type>pom</type>
> </dependency>
> <dependency>
> <groupId>com.artifact_software.lms</groupId>
> <artifactId>lms-pom-jsf</artifactId>
> <version>${lms-project.version}</version>
> <type>pom</type>
> </dependency>
> </dependencies>
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-assembly-plugin</artifactId>
> <version>2.2-beta-2</version>
> <executions>
> <execution>
> <id>create-jar-deployment-archive</id>
> <phase>package</phase>
> <goals>
> <goal>single</goal>
> </goals>
> <configuration>
> <descriptorRefs>
> <descriptorRef>
>                                     jar-with-dependencies
> </descriptorRef>
> </descriptorRefs>
> </configuration>
> </execution>
> </executions>
> </plugin>
> </plugins>
> </build>
>
> </project>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to