Powered by OPF
OPF WIKI STATIC ARCHIVE
2,681 pages · 153 spaces · 776 tags · 4,025 history records · 96.2% of the original wiki recovered
Archived copy. This page was recovered from the Internet Archive snapshot of /pages/viewpage.action?pageId=13763726 taken on 2023-01-31. The original wiki at wiki.opf-labs.org is being decommissioned.

arc-unpack

Added by Asger Askov Blekinge · last edited by Asger Askov Blekinge · on Apr 23, 2012

Arc unpack as a debian package

First, we need to define a few properties in the pom file

Pom file properties

Basically, these just allows us to use consistent names in the plugin configs that follow.

Then we come to the <build> section. The first thing to do, is to enable filtering on the resources. This is done such

The effect of this is that you can use $

Unknown macro: {maven.deb.name}

and the like in the config files, and have this replaced during the build. 

Firstly, we want to ensure that the jar file is as executable as we can easily make it. To do this, we must make a manifest. This is done with the jar-plugin

In the manifest, I declare the main class, and the classpath. Notice that I declare the classpathPrefix to be the maven.deb.libfolder, in order for the system to be able to resolve the dependencies when installed as a debian package.

Okay, the jar file is now generated correctly. Lets start on generating the package. First, we need to use maven to get all the dependencies. This is done with the assembly plugin

This plugin uses the deb assembly. So, what will the deb.assembly do? Lets look at it. 

Basically, it puts all the jar dependencies of the project in one dir, ready for inclusion in the debian package. 

Time to make the first version of the deb. We need another plugin in the pom file to do that.

Note that it is important that this plugin is placed below the assembly plugin, as they both execute in the package phase, and jdeb depends on the debian assembly having been run.

So, what will this plugin do?

Well, it will make a debian package, with the filename $

Unknown macro: {project.build.directory}

/$

Unknown macro: {artifactId}

$

Unknown macro: {version}

-java.deb.

The control file should be found in $

/classes/debian/control/