I have a project directory like:
        C:\home\projects\<myproject>
        
In <myproject> there is <myproject>\pom.xml

This pom is a top level pom (for many modules and those modules have
sub-modules)
and the packageing is set to "pom".

What I want is to build one super jar that includes all jars in my project
and all jars that were downloaded as dependencies (and dependencies of
dependencies).

How do I do this?

I included in my top level pom in the build section the maven-assembly
plugin
but that just created a jar with some apache classes and did not include my
jars (my modules) or any dependencies (like Spring, Log4J, etc).

This is the <build> section of my top level pom.xml
(<packaging>pom</packaging>
    <build>
            <plugins>
                <!-- Compiler -->
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                        <showDeprecation>true</showDeprecation>
                        <showWarnings>true</showWarnings>
                        <!-- Commented out fork to see if it fixes continuum
build -->
                        <!-- <fork>true</fork> -->
                    </configuration>
                    <!-- <compilerOption>-enableassertions</compilerOption>
-->
                </plugin>

                <!--
******************************************************************** -->
                <plugin> <!-- build a single superjar with all this project
.jars and all dependent jars like spring, log4j etc (every <dependency>
section will result in the inclusion of one or more jars in the super pom
-->
                    <artifactId>maven-assembly-plugin</artifactId>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>assembly</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <descriptorRefs>
                           
<descriptorRef>jar-with-dependencies</descriptorRef>
                        </descriptorRefs>
                    </configuration>
                </plugin>


-- 
View this message in context: 
http://www.nabble.com/Problems-with-maven-building-a-%22super-jar%22-tp21278586p21278586.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to