Skip to content

rexorient/onejar-maven-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is forked from https://code.google.com/p/onejar-maven-plugin/ to fix issues with included AWS jars.

Lets you build an executable jar with Maven2, containing all dependencies.

You can do that with the assembly plugin too, but that will just unpack all dependencies together with your classes in one directory and then repack that directory into a new jar. Doing it that way means files will overwrite each other if they have the same names in the same path, which is quite common with resources such as log4.properties and even other more important files.

With onejar-maven-plugin, you'll instead get a nice clean super jar with the dependency jars inside.

Get started by following the Usage instructions!

Changes from the original

The fork packages a patched one-jar 0.97 from iceberg901 and uses that version by default. The original 0.97 is still intact and can be used by specifying the onejarVersion configuration option in the maven pom.xml.

Example pom.xml build plugin configuration

...
<build>
	<plugins>
		<plugin>
			<groupId>com.github.sampov2</groupId>
			<artifactId>onejar-maven-plugin</artifactId>
			<version>1.4.6</version>
			<executions>
				<execution>
					<configuration>
						<mainClass>my.package.Foo</mainClass>
						<attachToBuild>true</attachToBuild>
					</configuration>
					<goals>
						<goal>one-jar</goal>
					</goals>
				</execution>
			</executions>
		</plugin>
	</plugins>
</build>

<pluginRepositories>
	<pluginRepository>
		<id>com.github.sampov2.onejar-maven-plugin</id>
		<url>http://maven.codeforcode.com/repository</url>
	</pluginRepository>
</pluginRepositories>
...

About

My fork of onejar-maven-plugin

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%