How to make a can of cans using maven

Possible duplicate:
Including bank dependencies with Maven

I am new to maven and would like to create a jar containing jars with dependencies using maven. But I could not do it. Please help me with this.

+5
source share
3 answers

You must include the following in your pom.xmlfile.

<build>
<plugins>
    <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
            <archive>
                <manifest>
                    <mainClass>MainClass with the packages</mainClass>
                </manifest>
            </archive>
            <descriptorRefs>
                <descriptorRef>jar-with-dependencies</descriptorRef>
            </descriptorRefs>
        </configuration>
    </plugin>
</plugins>

0
source

, , , ( ). One-Jar, , . - UberJar, ( Shade), .

, UberJar Shade Maven1 Maven2 . , ( , ).

0

Use the plugin shade:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
    <version>1.7</version>
<executions>
    <execution>
    <phase>package</phase>
    <goals>
        <goal>shade</goal>
    </goals>
    </execution>
</executions>
</plugin>
0
source

All Articles