You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by pdelaney <de...@gmail.com> on 2007/10/25 18:39:36 UTC

maven-assembly-plugin

Hello;

I am trying to build a jar file from our maven2 build.  The project is a web
project and we have a process that runs on the server as a Java application. 
I have been fooling around with the maven-assembly-plugin to try to get it
to build a batch.jar file that I can use to execute a Java program.   

My attempts have been futile.   I tried building my own assembler file
batch-bin.xml and it is not coming together easily for me.   I am missing
something.  

My ultimate goal is to have a batch.jar file created with all of the
dependencies in the project placed into this jar as .class files NOT jar
files.   I also want the MANEFEST.MF file created so that I can execute java
-jar batch.jar  on the command line.

Could someone point me to a good example page or mail me an example.  I've
read the docs sonatype and apache.maven site on assembly and I am not
getting it.


Thank you
Peter
-- 
View this message in context: http://www.nabble.com/maven-assembly-plugin-tf4692100s177.html#a13410974
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: maven-assembly-plugin

Posted by Nick Stolwijk <ni...@planet.nl>.
Let's split it in two sections:
>  
>
> My ultimate goal is to have a batch.jar file created with all of the
> dependencies in the project placed into this jar as .class files NOT jar
> files. 
This is a easy one, if you have the right plugin. Although the assembly 
plugin has an unpack goal, you'd want the unpack tasks of the dependency 
plugin, ie:

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack-dependencies</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            
<outputDirectory>${project.build.directory}/classes</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

For more information about this goal, see [1].
> I also want the MANEFEST.MF file created so that I can execute java
> -jar batch.jar  on the command line.
To create the MANIFEST file, take a look at the jar plugin. It has two 
pages about customizing the manifest. See [2] and [3].

Hth,

Nick Stolwijk

[1] 
http://maven.apache.org/plugins/maven-dependency-plugin/unpack-dependencies-mojo.html
[2] 
http://maven.apache.org/plugins/maven-jar-plugin/examples/manifest-customization.html
[3] 
http://maven.apache.org/plugins/maven-jar-plugin/examples/manifest-file.html

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