[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Building maven packages

On Wed, 2 Nov 2016 14:21, Markus Koschany wrote:

[I'm not on debian-java so keep me cc:ed please - I only found your
reply via the list archive]

But thanks for the quick and helpful response.

> On 02.11.2016 05:52, Wookey wrote:

> > Thre is also a load of stuff about osgi in the .pom files, which
> > seems to be some packaging format for java (different from
> > jars). Do I care about this? Can I easily just nobble the making
> > of osgi packages and thus simplafy my dependency tree?

Can someone explain what these osgi 'bundles' are? How does that
relate to the .jars I am familiar with? The same stuff packaged up in
a different format? Who uses those? Are they any use in Debian packages?

> At the moment I'm looking at
> https://svn.java.net/svn/javolution~svn/tags/V6_0/javolution/core-java/pom.xml:
> The pom.xml looks straightforward to me. For the OSGi stuff you will
> have to build-depend on libosgi-core-java and libosgi-compendium-java
> and libmaven-bundle-plugin-java.

> Although it is also possible to package javolution with javahelper
> and a self-made ant script, I would recommend to use
> maven-debian-helper instead.

> For example check out jboss-xnio which makes use of maven-debian-helper.

> > I've tried using the poms, by using mh_make to make some rules
> > that might be about right (which seem to use maven via cdbs),

Is it right to be using cdbs (to drive mh*), when dh (driving mh*) is
generally preferred these days? I don't mind cdbs personally, but
wonder if this is optimal - is that just what mh_make defaults to?

it is that there is no such thing as dh --with-maven-helper yet?

> > Having hacked about a bit it currenty fails with: 
> > The POM for org.codehaus.mojo:native-maven-plugin:jar:1.0-alpha-7 is missing,
> > no dependency information available

> > This is listed in the pom.xml file under "Native Plugin Default
> > Configuration (EXE)" with talk about 'adding support for Visual
> > studio 2010'. I don't think I care about > any of that, so I added
> > > org.codehaus.mojo native-maven-plugin * * * * > to
> > debian/maven.ignoreRules > (is that right, or is this in fact
> > needed for building the cpp .so part?)  > If it is needed how do I
> > get it? There doesn't seem to be a packaged maven/java > version
> > of it.

> Javolution builds a Java library and a native library. If you don't
> need the native library 

I presume that a proper packaging of javolution would include the
native library, although I don't actually know if the depending
project (jscience) uses it. It seems to only mention javolution.jar
(and builds if that is supplied), so I guess that I can get away with
just that part for now.

> your solution is correct and you can add the
> artifact (jar file)

> org.codehaus.mojo native-maven-plugin * * * *

> to maven.ignoreRules.

Doing this doesn't make it build. It still fails with:
cd . && /usr/lib/jvm/default-java/bin/java -noverify -cp /usr/share/maven/boot/plexus-classworlds-2.x.jar:/usr/lib/jvm/default-java/lib/tools.jar  -Dclassworlds.conf=/etc/maven/m2-debian.conf -Dmaven.home=/usr/share/maven -Dmaven.multiModuleProjectDirectory=/home/wookey/packages/jscience/javolution/javolution-6.0.0 org.codehaus.plexus.classworlds.launcher.Launcher -s/etc/maven/settings-debian.xml -Dmaven.repo.local=/home/wookey/packages/jscience/javolution/javolution-6.0.0/debian/maven-repo  package -DskipTests
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unknown packaging: bundle @ line 7, column 13
[ERROR] Unknown packaging: so @ line 7, column 13
[ERROR] The build could not read 2 projects -> [Help 1]
[ERROR]   The project org.javolution:javolution-core-java:6.0.0 (/home/wookey/packages/jscience/javolution/javolution-6.0.0/core-java/pom.xml) has 1 error
[ERROR]     Unknown packaging: bundle @ line 7, column 13
[ERROR]   The project org.javolution:libjavolution-core-cpp:6.0.0 (/home/wookey/packages/jscience/javolution/javolution-6.0.0/core-cpp/pom.xml) has 1 error
[ERROR]     Unknown packaging: so @ line 7, column 13
/usr/share/cdbs/1/class/maven.mk:92: recipe for target 'mvn-build' failed
(With exactly the same error for the 'cleanbuilddir' target)

> Otherwise someone has to package maven-native-plugin.

> https://bugs.debian.org/700679

Well I don't mind doing this if it's not too hard, and I don't have too
many more layers of java-package rabbit-hole to go :-).

That bug says "I left the packaging work I was doing up on
git.debian.org", but I can't find it.

There is a 2009 https://anonscm.debian.org/cgit/users/twerner/maven-native.git
which I think is an earlier version of the same package
but doesn't have a debian dir, so I guess torsten didn't get very far.

I'll mail Andres Mejia for clarification, but if anyone knows where
existing work might be...

> Just add libmaven-bundle-plugin-java to Build-Depends. I hope that will
> do the trick.

Yep - that worked. How could I have worked out myself that
complaints about apache.felix meant I wanted that package?

Principal hats:  Linaro, Debian, Wookware, ARM

Reply to: