1

I want to package a java client together with a runtime into one Zip-file.

How should I do this with maven?

Java Client:

package com.test.client;

public class Client {
    public static void main(String[] args) {
        System.out.println("Hello world!");
    }
}

This runs like:

java -cp "client.jar" com.test.Client

I want to deliver one zip-file with the jre: client.zip

/client.jar
/jre/
Dimitri Dewaele
  • 10,311
  • 21
  • 80
  • 127

2 Answers2

3

Take a look at Apache Maven Assembly Plugin.

For datailed instructions, see here and here.

Community
  • 1
  • 1
Bob Rivers
  • 5,261
  • 6
  • 47
  • 59
0

Have a look at the shade plugin https://maven.apache.org/plugins/maven-shade-plugin/. This supersedes the assembly plugin I believe.

slarge
  • 637
  • 1
  • 7
  • 19