Maven - JRE (Including it in your distribution)

Card Puncher Data Processing


A JRE is just a dependency

Therefore you can upload it to a repository and use it in your build.


Define the unique identifier

With a file named, we will get the following artifact coordinates:



Get the JRE from the Oracle website and repackage it to get:

  • a zip file named
  • with only one sub directory named jre.

With the deploy-file goal, you can deploy it to a remote repository.


mvn deploy:deploy-file \
           -Durl=scp://host:22/home/gerardni-m2repo \
           -DrepositoryId=m2-repo \
           -Dfile="pathTo/" \
           -DartifactId=jre \
           -Dversion=1.7.80 \
           -Dpackaging=zip \

Build (get and unzip)

Add the below plugin dependency configuration to your pom.xml in order to unpack (ie unzip)


Add the JRE to the zip

With the assmbly plugin, add the following fileset in your descriptor file:


Documentation / Reference

Share this page:
Follow us:
Task Runner