Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mvn install jar-with-dependencies

Tags:

maven

Is there a way to do an install on a jar-with-dependencies created using maven-assembly-plugin?

like image 608
DD. Avatar asked Jan 19 '11 11:01

DD.


2 Answers

If you bind the assembly to the packaging phase, it will install in your repository both the "regular" jar and the with-dependencies jar when you do a build:

        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.3</version>
            <configuration>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
            </configuration>
            <executions>
                <execution>
                    <id>make-assembly</id> <!-- this is used for inheritance merges -->
                    <phase>package</phase> <!--  bind to the packaging phase -->
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
like image 163
pablacious Avatar answered Oct 19 '22 15:10

pablacious


mvn assembly:assembly -DdescriptorId=jar-with-dependencies

:)

like image 26
Nook Avatar answered Oct 19 '22 16:10

Nook