Bug#1007923: maven-debian-helper: comply to java policy and fix W: bad-jar-name

Alexandre Rossi niol at zincube.net
Fri Mar 18 15:34:42 GMT 2022


Package: maven-debian-helper
Version: 2.6
Severity: normal
Tags: patch

Dear Maintainer,

When I build a package, for instance libhtmlcleaner-java, with maven-debian-helper,
I get in my lintian output:

    W: bad-jar-name usr/share/java/htmlcleaner.jar

Debian Java packaging policy states (§ 2.4):

    Their classes must be in jar archive(s) in the directory /usr/share/java,
    with the name packagename[-extraname]-fullversion.jar. The extraname
    is optional and used internally within the package to separate the
    different jars provided by the package. The fullversion is the version
    of that jar file. In some cases that is not the same as the package
    version.

    Some package must also provide a symbolic link from
    packagename-extraname.jar to the most compatible version of the available
    packagename-extraname-version.jar files. 

But as installed I have:

    $ ls -l /usr/share/java/htmlcleaner*
    /usr/share/java/htmlcleaner-2.24.jar -> htmlcleaner.jar
    /usr/share/java/htmlcleaner.jar

I understand from the policy that the symbolic link should be the version-less
path.

The following path seems to fix the problem.

--- a/debian-maven-plugin/src/main/java/org/debian/maven/plugin/SysInstallMojo.java
+++ b/debian-maven-plugin/src/main/java/org/debian/maven/plugin/SysInstallMojo.java
@@ -592,12 +592,10 @@ public class SysInstallMojo extends AbstractMojo {
         if (jarFile.exists()) {
             getLog().info("Install jar for " + artifactId + " into /usr/share/java");
             mkdir(compatSharePath());
-            if (noUsjVersionless) {
-                FileUtils.copyFile(jarFile, new File(versionedFullCompatPath()));
-            } else {
-                FileUtils.copyFile(jarFile, new File(fullCompatPath()));
-                link(destUsjJarName(), fullCompatPath());
-                link(destUsjJarName(), versionedFullCompatPath());
+            FileUtils.copyFile(jarFile, new File(versionedFullCompatPath()));
+            if (!noUsjVersionless) {
+                link(destUsjVersionnedJarName(), fullCompatPath());
+                link(destUsjVersionnedJarName(), versionedFullCompatPath());
             }
         }
     }
@@ -611,11 +609,7 @@ public class SysInstallMojo extends AbstractMojo {
             mkdir(fullRepoPath());
             String targetPath = "";

-            if (noUsjVersionless) {
-                targetPath = versionedFullCompatPath();
-            } else {
-                targetPath = fullCompatPath();
-            }
+            targetPath = versionedFullCompatPath();

             link(DirectoryUtils.relativePath(fullRepoPath(), targetPath), jarDestPath());
             if (debianVersion != null && !debianVersion.equals(version)) {


-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-12-amd64 (SMP w/4 CPU threads)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages maven-debian-helper depends on:
ii  default-jdk                     2:1.11-72
ii  default-jdk-headless            2:1.11-72
ii  libmaven-clean-plugin-java      3.1.0-1
ii  libmaven-compiler-plugin-java   3.8.1-4
ii  libmaven-jar-plugin-java        3.1.2-1
ii  libmaven-resources-plugin-java  3.1.0-1
ii  libmaven-site-plugin-java       3.6-4
ii  libplexus-velocity-java         1.2-3.1
ii  libsurefire-java                2.22.3-1
ii  libxml2-utils                   2.9.13+dfsg-1
ii  maven                           3.6.3-5
ii  maven-repo-helper               1.10
ii  unzip                           6.0-26
ii  velocity                        1.7-6

maven-debian-helper recommends no packages.

Versions of packages maven-debian-helper suggests:
ii  apt-file                      3.2.2
ii  libmaven-javadoc-plugin-java  3.0.1-4
ii  licensecheck                  3.2.14-2
pn  subversion                    <none>

-- no debconf information


More information about the pkg-java-maintainers mailing list