Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.java > #8344

How should I deal with the classpath with maven-helper?

From Guillaume Turri <guillaume.turri@gmail.com>
Newsgroups linux.debian.maint.java
Subject How should I deal with the classpath with maven-helper?
Date 2015-09-16 20:20 +0200
Message-ID <q9pth-3Ot-47@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

I'm trying to package some java code with maven-helper, and I have a
few questions regarding the class-path of the built jar.

To put it in a nutshell: how should it be handled? What are the good practices?

More precisely:
* If I don't do anything special regarding the class-path, then I get
the lintian warning missing-classpath [1]
* If I add the classpath via the pom.xml, ie

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-jar-plugin</artifactId>
      <configuration>
        <archive>
          <manifest>
            <addClasspath>true</addClasspath>
          </manifest>
        </archive>
      </configuration>
    </plugin>

 then the warning goes away, but the MANIFEST of the built jar
contains a class-path like

    Class-Path: guava-debian.jar aXMLRPC-debian.jar

so when I try to launch my application with a wrapper script which looks like

    java -cp /usr/share/java/my.jar

it fails as soon as it tries to load a class from another jar since it
can't find them.

Of course, for an application I could just add manually the jar needed
in my wrapper script. However, it wouldn't apply to the case when I
try to package a library

I've tried to look in existing packages and in the documentation, but
couldn't find an answer. I would
be grateful if you can give me some pointers.

Regards,
Guillaume

[1]: https://lintian.debian.org/tags/missing-classpath.html

Back to linux.debian.maint.java | Previous | NextNext in thread | Find similar


Thread

How should I deal with the classpath with maven-helper? Guillaume Turri <guillaume.turri@gmail.com> - 2015-09-16 20:20 +0200
  Re: How should I deal with the classpath with maven-helper? Emmanuel Bourg <ebourg@apache.org> - 2015-09-16 21:40 +0200
    Re: How should I deal with the classpath with maven-helper? Guillaume Turri <guillaume.turri@gmail.com> - 2015-09-16 22:10 +0200

csiph-web