Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

jar missing in /usr/share/maven-repo/

9 views
Skip to first unread message

Andreas B. Mundt

unread,
Jul 4, 2023, 4:30:03 PM7/4/23
to
Hi,

to package filius[1], I need to add the maven stuff to
libhtmlparser-java. I patched the existing package [2], however,
the link to the jar is missing in /usr/share/maven-repo/. It seems
to work fine for the POM. Any help is appreciated!

Best regards,

Andi


[1] https://lists.debian.org/debian-java/2023/05/msg00008.html
[2] https://salsa.debian.org/andi/libhtmlparser-java/-/commit/17a0ea0d29dcfcdf9128316454dd9ec83ea58531

Pierre Gruet

unread,
Jul 4, 2023, 4:52:03 PM7/4/23
to
Hello Andreas,

Le 04/07/2023 à 22:02, Andreas B. Mundt a écrit :
> Hi,
>
> to package filius[1], I need to add the maven stuff to
> libhtmlparser-java. I patched the existing package [2], however,
> the link to the jar is missing in /usr/share/maven-repo/. It seems
> to work fine for the POM. Any help is appreciated!

You could try to change the contents of d/libhtmlparser-java.poms to

debian/pom.xml --no-parent --java-lib --artifact=src/lib/libhtmlparser.jar

and also to remove d/libhtmlparser-java.jlibs.

The latter will prevent the installation of the jar in /usr/share/java
while the former will install it in the relevant subdir of
/usr/share/maven-repo and put a symlink in /usr/share/java (or the
contrary, not sure).

Let us know if this works!

>
> Best regards,
>
> Andi
>
>
Best,

--
Pierre
OpenPGP_signature

Andreas B. Mundt

unread,
Jul 5, 2023, 2:40:03 PM7/5/23
to
Hi Pierre,

many thanks for your quick reply!

> […]
>
> You could try to change the contents of d/libhtmlparser-java.poms to
>
> debian/pom.xml --no-parent --java-lib --artifact=src/lib/libhtmlparser.jar
>
> and also to remove d/libhtmlparser-java.jlibs.
>
> The latter will prevent the installation of the jar in
> /usr/share/java while the former will install it in the relevant
> subdir of /usr/share/maven-repo and put a symlink in /usr/share/java
> (or the contrary, not sure).
>
> Let us know if this works!

Great, it works now! To get the version right, I added:

debian/pom.xml --no-parent --java-lib --artifact=src/lib/libhtmlparser.jar --usj-name=libhtmlparser --usj-version=1.6.20060610

Diff of the files' list in the package looks good:

--- /tmp/libhtmlparser-java-orig 2023-07-05 19:54:55.340310037 +0200
+++ /tmp/libhtmlparser-java-repo 2023-07-05 19:57:20.964737387 +0200
@@ -3,4 +3,8 @@
/usr/share/doc/libhtmlparser-java/changelog.gz
/usr/share/doc/libhtmlparser-java/copyright
/usr/share/java/libhtmlparser-1.6.20060610.jar
+/usr/share/maven-repo/org/htmlparser/htmlparser/1.6/htmlparser-1.6.pom
+/usr/share/maven-repo/org/htmlparser/htmlparser/debian/htmlparser-debian.pom
/usr/share/java/libhtmlparser.jar
+/usr/share/maven-repo/org/htmlparser/htmlparser/1.6/htmlparser-1.6.jar
+/usr/share/maven-repo/org/htmlparser/htmlparser/debian/htmlparser-debian.jar

In addition I packaged (draft) libsemantic-version-java with mh_make
which worked fine too.

I installed the new packages and all other dependencies and was able
to run mh_make on the filius sources. Building the package worked
after that. However, when I try to start it, I get:

$ java -jar /usr/share/java/filius.jar
Error: Unable to initialize main class filius.Main
Caused by: java.lang.NoClassDefFoundError: ch/qos/logback/core/joran/spi/JoranException

So far I have no idea what's wrong, I'll have to investigate further.
Again, any help/hint is appreciated!

Best regards,

Andi

Thorsten Glaser

unread,
Jul 5, 2023, 4:00:03 PM7/5/23
to
On Wed, 5 Jul 2023, Andreas B. Mundt wrote:

>after that. However, when I try to start it, I get:
>
> $ java -jar /usr/share/java/filius.jar
> Error: Unable to initialize main class filius.Main
> Caused by: java.lang.NoClassDefFoundError: ch/qos/logback/core/joran/spi/JoranException

I think you have to do:

java -cp /usr/share/java/logback.jar:/usr/share/java/foodependency.jar:… -jar /usr/share/java/filius.jar

It’s common to put that into a tiny shell script in /usr/bin.

bye,
//mirabilos
--
Infrastrukturexperte • tarent solutions GmbH
Am Dickobskreuz 10, D-53121 Bonn • http://www.tarent.de/
Telephon +49 228 54881-393 • Fax: +49 228 54881-235
HRB AG Bonn 5168 • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg

****************************************************
/⁀\ The UTF-8 Ribbon
╲ ╱ Campaign against Mit dem tarent-Newsletter nichts mehr verpassen:
 ╳  HTML eMail! Also, https://www.tarent.de/newsletter
╱ ╲ header encryption!
****************************************************

tony mancill

unread,
Jul 5, 2023, 11:30:04 PM7/5/23
to
On Wed, Jul 05, 2023 at 09:57:46PM +0200, Thorsten Glaser wrote:
> On Wed, 5 Jul 2023, Andreas B. Mundt wrote:
>
> >after that. However, when I try to start it, I get:
> >
> > $ java -jar /usr/share/java/filius.jar
> > Error: Unable to initialize main class filius.Main
> > Caused by: java.lang.NoClassDefFoundError: ch/qos/logback/core/joran/spi/JoranException
>
> I think you have to do:
>
> java -cp /usr/share/java/logback.jar:/usr/share/java/foodependency.jar:… -jar /usr/share/java/filius.jar
>
> It’s common to put that into a tiny shell script in /usr/bin.

You can use java-wrappers for this.

Here's an example of a wrapper script:

https://salsa.debian.org/java-team/jabref/-/blob/master/debian/jabref-wrapper

Which needs to be installed in the binary package:

https://salsa.debian.org/java-team/jabref/-/blob/master/debian/rules#L13

And be declared as a dependency of the binary package:

https://salsa.debian.org/java-team/jabref/-/blob/master/debian/control#L55

Cheers,
tony
signature.asc

Andreas B. Mundt

unread,
Jul 6, 2023, 1:50:03 PM7/6/23
to
Hi Thorsten, tony, all,

many thanks for your help! It almost started working now: I added a
wrapper script as suggested by tony and got rid of the missing class
definitions. However, the next challenge turned up: filius uses some
'resources' [1] which need to be available and I am not sure how to
solve this best. So far, they are not deployed by the packet
automatically, but a debian/libfilius-java.install file solves this.

The 'resources' are expected relative to /usr/share/java/filius.jar in
directories (i.e. config/filius.ini). How is it best to handle this
situation? Is it possible to tweak the path somehow (in the wrapper
script?) or do I need to patch the sources? Right now, I copy the
resources to /usr/share/filius/.

Many thanks in advance for help and hints,

Andi


[1] https://gitlab.com/filius1/filius/-/tree/master/src/main

Thorsten Glaser

unread,
Jul 6, 2023, 2:00:05 PM7/6/23
to
On Thu, 6 Jul 2023, Andreas B. Mundt wrote:

>The 'resources' are expected relative to /usr/share/java/filius.jar in
>directories (i.e. config/filius.ini). How is it best to handle this
>situation? Is it possible to tweak the path somehow (in the wrapper
>script?) or do I need to patch the sources? Right now, I copy the
>resources to /usr/share/filius/.

If “filius” is an end program, not a library that others could use,
I’d say place the JAR and resources both in /usr/share/filius/, skip
putting the JAR into /usr/share/java/. But that’s just my opinion,
others can put in something from best practices or so.
0 new messages