Hi,

 I am a bit confused how java libraries should be installed.
 The manual states:

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. [1]

But the actual observed result is both:
 picocli-codegen.jar -> picocli-codegen-4.6.2.jar
and
 pegdown-1.6.0.jar -> pegdown.jar

Notice symbolic link created from package-extraname.jar to
package-extraname-fullversion.jar which is vice versa of what is
stated in the guidelines.

I am not sure if it is a bug or a feature for some libraries, so I
would like to ask whether this behaviour is correct.

I have attached a patch to maven-debian-helper that copies
package-extraname-fullversion.jar rather than package-extraname.jar
(just in case it is a bug).

Best Regards,
 Vladimir.

[1] https://www.debian.org/doc/packaging-manuals/java-policy/ch02.html
diff --git 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
index 40b6a5c..9afb627 100644
--- 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
@@ -595,9 +595,9 @@ public class SysInstallMojo extends AbstractMojo {
             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()));
+                link(destUsjVersionnedJarName(), fullCompatPath());
+                link(destUsjVersionnedJarName(), versionedFullCompatPath());
             }
         }
     }
diff --git a/debian-maven-plugin/src/test/java/org/debian/maven/plugin/InstallMojoTest.java b/debian-maven-plugin/src/test/java/org/debian/maven/plugin/InstallMojoTest.java
index 0ab7508..a63f953 100644
--- a/debian-maven-plugin/src/test/java/org/debian/maven/plugin/InstallMojoTest.java
+++ b/debian-maven-plugin/src/test/java/org/debian/maven/plugin/InstallMojoTest.java
@@ -109,17 +109,17 @@ public class InstallMojoTest {
         assertNotNull(usjJar);
         File versionedUsjJar = getFileInClasspath("plexus-compiler/debian/libplexus-compiler-java/usr/share/java/plexus-compiler-api-1.8.2.jar");
         assertNotNull(versionedUsjJar);
-        assertSameFile(usjJar, versionedUsjJar);
+        assertSameFile(versionedUsjJar, usjJar);
 
         File versionedRepoJar = getFileInClasspath("plexus-compiler/debian/libplexus-compiler-java/usr/share/maven-repo/org/codehaus/plexus/plexus-compiler-api/1.8.2/plexus-compiler-api-1.8.2.jar");
         assertNotNull(versionedRepoJar);
-        assertSameFile(usjJar, versionedRepoJar);
+        assertSameFile(versionedUsjJar, versionedRepoJar);
         File versionedRepoPom = getFileInClasspath("plexus-compiler/debian/libplexus-compiler-java/usr/share/maven-repo/org/codehaus/plexus/plexus-compiler-api/1.8.2/plexus-compiler-api-1.8.2.pom");
         assertNotNull(versionedRepoPom);
 
         File debianRepoJar = getFileInClasspath("plexus-compiler/debian/libplexus-compiler-java/usr/share/maven-repo/org/codehaus/plexus/plexus-compiler-api/1.x/plexus-compiler-api-1.x.jar");
         assertNotNull(debianRepoJar);
-        assertSameFile(usjJar, debianRepoJar);
+        assertSameFile(versionedUsjJar, debianRepoJar);
         File debianRepoPom = getFileInClasspath("plexus-compiler/debian/libplexus-compiler-java/usr/share/maven-repo/org/codehaus/plexus/plexus-compiler-api/1.x/plexus-compiler-api-1.x.pom");
         assertNotNull(debianRepoPom);
 
@@ -177,9 +177,9 @@ public class InstallMojoTest {
             resource = "/" + resource;
         }
         URL url = this.getClass().getResource(resource);
-        
+
         assertNotNull("Resource " + resource + " not found in the classpath", url);
-        
+
         File f;
         try {
             f = new File(url.toURI());
__
This is the maintainer address of Debian's Java team
<https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-java-maintainers>.
 Please use
[email protected] for discussions and questions.

Reply via email to