Maven ZIP Artifact: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Maven assembly Plugin !!!The simplest way to create a ZIP artifact The following will create a test site co...")
 
 
(2 intermediate revisions by the same user not shown)
Line 3: Line 3:
* [[Maven_assembly_Plugin#Other_Assembly_Use_Cases|Maven assembly Plugin]]
* [[Maven_assembly_Plugin#Other_Assembly_Use_Cases|Maven assembly Plugin]]


 
=Overview=
!!!The simplest way to create a ZIP artifact


The following will create a test site content zip. The assembly plug in is the only "active" plug-in for a sub-module whose whole reason to exist is to create the content zip.
The following will create a test site content zip. The assembly plug in is the only "active" plug-in for a sub-module whose whole reason to exist is to create the content zip.


!!pom.xml
=pom.xml=


{{{
<pre>
<plugins>
<plugins>
            ...
    ...
            <plugin>
    <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
        <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
        <configuration>
                    <descriptors>
            <descriptors>
                        <descriptor>assembly.xml</descriptor>
                <descriptor>assembly.xml</descriptor>
                    </descriptors>
            </descriptors>
                </configuration>
        </configuration>
                <executions>
        <executions>
                    <execution>
            <execution>
                        <id>make-assembly</id>
                <id>make-assembly</id>
                        <phase>package</phase>
                <phase>package</phase>
                        <goals>
                <goals>
                            <goal>single</goal>
                    <goal>single</goal>
                        </goals>
                </goals>
                    </execution>
            </execution>
                </executions>
        </executions>
            </plugin>
    </plugin>
            ...
    ...
}}}
</plugins>
</pre>


!!assembly.xml
=assembly.xml=


{{{
<pre>
<assembly>
<assembly>
     <formats>
     <formats>
Line 48: Line 48:
     </fileSets>
     </fileSets>
</assembly>
</assembly>
}}}
</pre>

Latest revision as of 15:46, 7 November 2016

Internal

Overview

The following will create a test site content zip. The assembly plug in is the only "active" plug-in for a sub-module whose whole reason to exist is to create the content zip.

pom.xml

<plugins>
    ...
    <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
            <descriptors>
                <descriptor>assembly.xml</descriptor>
            </descriptors>
        </configuration>
        <executions>
            <execution>
                <id>make-assembly</id>
                <phase>package</phase>
                <goals>
                    <goal>single</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
    ...
</plugins>

assembly.xml

<assembly>
    <formats>
        <format>zip</format>
    </formats>
    <baseDirectory>.</baseDirectory>
    <includeBaseDirectory>false</includeBaseDirectory>
    <fileSets>
        <fileSet>
            <directory>archimedes-test-site</directory>
        </fileSet>
    </fileSets>
</assembly>