Hello, something like the following works for me everytime. The only drawback
is long compile times on slow machines. HTH, David
**************************************************************
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>test.Test</mainClass>
<packageName>test</packageName>
<addClasspath>true</addClasspath>
</manifest>
<manifestEntries>
<mode>development</mode>
<url>${pom.url}</url>
</manifestEntries>
<manifestFile>src/main/java/test/MANIFEST.MF</manifestFile>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<manifest>
<mainClass>test.Test</mainClass>
<packageName>test</packageName>
<addClasspath>true</addClasspath>
</manifest>
<manifestFile>src/main/java/test/MANIFEST.MF</manifestFile>
</configuration>
</plugin>
**********************************************************************
Run this at your POM.XML command-line directory:
mvn clean install assembly:assembly
cablepuff wrote ..
>
> Hi i have a runnable jar files that depends on hibernate and spring (latest
> version of their jar file respectively).
>
> I tried maven-jar-plugin.
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-jar-plugin</artifactId>
> <configuration>
> <archive>
> <manifest>
> <addClasspath>true</addClasspath>
> <mainClass>company.main.execute</mainClass>
> </manifest>
> </archive>
> </configuration>
> </plugin>
>
> but this doesn't allow me to distribute the file to other machine.
>
> I also tried maven assembly plugin.
>
> <plugin>
> <artifactId>maven-assembly-plugin</artifactId>
> <configuration>
> <filters>
>
> <filter>src/main/filters/build.properties</filter>
> </filters>
> <descriptors>
>
> <descriptor>src/main/assemble/descriptor.xml</descriptor>
> </descriptors>
> <workDirectory>target/assembly/work</workDirectory>
> <archive>
> <manifest>
> <mainClass>company.main.execute</mainClass>
> </manifest>
> </archive>
> </configuration>
> </plugin>
>
> my descriptor.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <assembly>
> <id>jar-with-dependencies</id>
> <formats>
> <format>jar</format>
> </formats>
> <includeBaseDirectory>false</includeBaseDirectory>
> <dependencySets>
> <dependencySet>
> <outputDirectory>lib</outputDirectory>
> <unpack>true</unpack>
> <scope>runtime</scope>
> </dependencySet>
> </dependencySets>
> <fileSets>
> <fileSet>
> <directory>target/classes</directory>
> <outputDirectory></outputDirectory>
> </fileSet>
> </fileSets>
> </assembly>
>
> however i get this error
> about namespace www.springframework.org/schema/tx cannot be found.
>
> Is their a better way to create deployable jar files that runs on different
> machine.
>
> --
> View this message in context:
> http://www.nabble.com/creating-runnable-jar-file-tp19289532p19289532.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]
Yet some, not wise, go to the other side of the globe, to barbarous and
unhealthy regions, and devote ten or twenty years, in that they may live,-that
is, keep comfortably warm,- and die in New England at last.
Henry David Thoreau - Walden - 1845
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]