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

Re: Packaging Jena, and mh_make trouble



Hello Alexander,

Things can get quickly hairy with Java packaging, and when coupled with
Maven, you'd better have more a just a passing familiarity with Maven...

mh_make tries to make the heavy lifting for you, but it's never perfect
and I find always new cases, like yours.

With a more recent version of mh_make, I have been able to get a bit
further, but not by much. I will try to keep improving the tool for
those use cases.

Using the --no-parent option is something that is tricky. In some cases,
it's quite harmless to do, as the parent only contains some developer
information, license, defaults for some plugins which can be ignored,
but in your case the parent contains important information
(dependencies) which cannot be ignored. So you need to package as well
the parent POM.

Now it seems useless to create a package for a single file (and the FTP
team will not like you for doing so), so you need to include this file
in your package. You can either copy it in the debian/ folder, or you
can use the technique of source packages with multiple upstreams. I'm
using it, and it rocks.

I'm sending you my work in progress on this package. There is one
troublesome dependency remaining: it's ic4j, and the version used by
Jena is 3.4.4, while versions 4.0, 4.2 and 4.4 (!) are packaged in
Debian. Maybe you can suggest upstream to do an upgrade or patch the
package to make it work with a new version of this library.

Hope this helps,
Ludovic

On 18/02/2012 00:51, Alexander Dutton wrote:
> Hi all,
> 
> First off, I'm new to Java packaging, so apologies if I'm missing
> something obvious.
> 
> I'd like to get Jena¹, a Java framework for semantic web applications,
> into Debian, picking up on #563793². That ITP references work done 5
> years ago, and doesn't cover other facets of Jena, such as ARQ, TDB,
> and Fuseki.
> 
> Following the instructions at
> <http://wiki.debian.org/Java/MavenDebianHelper> I started by running the
> following:
> 
>> mh_make
>> --from-svn=https://svn.apache.org/repos/asf/incubator/jena/Jena2/IRI/trunk/
>> -pjena-iri -blibjena-iri-java -ttrue -dtrue
> 
> which complained about being unable to find the parent POM, even though
> it was told to ignore it:
> 
>> In pom.xml: Ignore the parent POM for this POM? 
>> org.apache.jena:jena-top:pom:0-incubating [y]/n > y [ERROR] Cannot
>> find parent dependency org.apache.jena:jena-top:pom:0-incubating,
>> use --no-parent option to resolve this issue or install the parent
>> POM in the Maven repository
> 
> and eventually died with the following:
> 
>> 17-Feb-2012 21:40:36
>> org.debian.maven.packager.DependenciesSolver$ToResolve resolve 
>> SEVERE: Cannot resolve dependencies on ./pom.xml 
>> java.lang.ClassCastException: org.debian.maven.repo.Dependency
>> cannot be cast to java.lang.Comparable at
>> java.util.TreeMap.put(TreeMap.java:559) at
>> java.util.TreeSet.add(TreeSet.java:255) at
>> org.debian.maven.packager.DependenciesSolver.resolveDependencies(DependenciesSolver.java:611)
> 
> 
> at
> org.debian.maven.packager.DependenciesSolver.access$000(DependenciesSolver.java:46)
>> at
>> org.debian.maven.packager.DependenciesSolver$ToResolve.resolve(DependenciesSolver.java:279)
> 
> 
> at
> org.debian.maven.packager.DependenciesSolver.resolveDependenciesNow(DependenciesSolver.java:568)
>> at
>> org.debian.maven.packager.DependenciesSolver.solveDependencies(DependenciesSolver.java:448)
> 
> 
> at
> org.debian.maven.packager.DependenciesSolver.main(DependenciesSolver.java:916)
>> [ERROR] Cannot find parent dependency
>> org.apache.jena:jena-top:pom:0-incubating, use --no-parent option
>> to resolve this issue or install the parent POM in the Maven
>> repository [ERROR] Cannot find parent dependency
>> org.apache.jena:jena-top:pom:0-incubating, use --no-parent option
>> to resolve this issue or install the parent POM in the Maven
>> repository [ERROR] Cannot find parent dependency
>> org.apache.jena:jena-top:pom:0-incubating, use --no-parent option
>> to resolve this issue or install the parent POM in the Maven
>> repository [ERROR] Cannot find parent dependency
>> org.apache.jena:jena-top:pom:0-incubating, use --no-parent option
>> to resolve this issue or install the parent POM in the Maven
>> repository ERROR: pom.xml: Dependency is not packaged in the Maven
>> repository for Debian: junit:junit:${ver.junit}
> 
> 
> Trying another approach, I noticed plexus-cdc referenced as an
> exemplar³, and copied bits that looked relevant. This seemed to get me
> somewhere, but throws source version errors:
> 
>> compile: [mkdir] Created dir:
>> /home/alex/debian-packaging/jena-iri/build/generated-sources 
>> [javac] /usr/share/maven-ant-helper/maven-build.xml:295: warning:
>> 'includeantruntime' was not set, defaulting to
>> build.sysclasspath=last; set to false for repeatable builds [javac]
>> Compiling 43 source files to
>> /home/alex/debian-packaging/jena-iri/build/classes [javac]
>> /home/alex/debian-packaging/jena-iri/src/main/java/com/hp/hpl/jena/iri/IRI.java:83:
>> generics are not supported in -source 1.4 [javac] (use -source 5 or
>> higher to enable generics) [javac]     abstract public
>> Iterator<Violation> violations(boolean includeWarnings); [javac]
>> ^ [javac]
>> /home/alex/debian-packaging/jena-iri/src/main/java/com/hp/hpl/jena/iri/IRI.java:394:
>> annotations are not supported in -source 1.4 [javac] (use -source 5
>> or higher to enable annotations) [javac]     @Override [snip]
> 
> I can't work out how to tell it how it to use a more recent source
> version.
> 
> What I've got so far is at
> <https://github.com/alexsdutton/debian-jena-iri>.
> 
> Is there documentation I've missed? Where should I go from here?
> 
> 
> Kind regards,
> 
> Alexander
> 
> ¹ http://incubator.apache.org/jena/
> ² http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=563793
> ³ http://wiki.debian.org/Java/MavenBuilder
> 
> 
> 

Attachment: debian.tar.gz
Description: GNU Zip compressed data


Reply to: