Changes between Initial Version and Version 1 of java-packaging


Ignore:
Timestamp:
08/20/14 07:24:44 (10 years ago)
Author:
jlarouche
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • java-packaging

    v1 v1  
     1= Java Packaging =
     2
     3There a multiples way to package Java apps on Ubuntu.
     4
     5 1. Fastest way is to get the jar/war file and make a package containing them. Your debian/rules will simply extract it at the right place.
     6
     7 2. It ends up making a package similar to the first way, but using tools like jdeb to make it automatically for you.[[BR]]
     8
     9 jdeb(https://github.com/tcurdt/jdeb) is a plugin for maven/ant that automatically creates a package from your Java app if it's using Maven or Ant to build.
     10
     11 3. There are also tools to help creating a package built from source https://wiki.debian.org/Java/Packaging.
     12 
     13 It works out of the box for ants and manually building the app
     14
     15 4. For maven projects, Maven-Debian-Helper(https://wiki.debian.org/Java/MavenDebianHelper) makes it really easy to package an app if all the depencies are available.
     16
     17
     18== Maven Debian Helper ==
     19
     20For maven debian helper to work, your java apps need to build using maven. If the project you want to package doesn't have many dependencies, it's pretty easy to create a pom.xml file to make it maven compatible.
     21
     22Maven-Debian-Helper will use all the information found in the pom.xml file to create all the required files for the package. It will also look for any dependencies needed in the Ubuntu repository. Since it creates a standard Debian Package, it needs to be built from source. So all the dependencies must be available in a repository. The dependencies must also be packaging with a pom.xml file in the {{{/usr/share/maven-repo}}} as it is used as a offline repository by maven-debian-helper.
     23
     24If the dependencies is packaged but it's not the right version, you can create rules to modify the pom.xml file to use a different version when building.
     25
     26The most complicated things about this approach is converting the project to maven, if it has many dependencies this can take a while. Off course, you can use IDE like Eclipse or IntelliJ Idea to help you make the conversion. Once it is maven compatible, Maven-Debian-Helper is pretty straight forward.
     27
     28You can find a simple example of a package made using Maven-Debian-Helper here: https://scm.lan.mapgears.com/packages/debian/jsr-275