Workaround for badly formatted JNA jar
authorMathieu Baudier <mbaudier@argeo.org>
Sat, 7 Oct 2023 04:42:29 +0000 (06:42 +0200)
committerMathieu Baudier <mbaudier@argeo.org>
Sat, 7 Oct 2023 04:42:29 +0000 (06:42 +0200)
src/org/argeo/build/Repackage.java

index 8a9cac074e29e13b218440c165edc9afe8b97853..1a1f5c1d4b26fdfb768a476da0e1c832daa20ea2 100644 (file)
@@ -1485,9 +1485,13 @@ public class Repackage {
 
                        // license
                        String spdxLicenseId = SPDX_LICENSE_IDENTIFIER.get(mapping);
-                       if (spdxLicenseId == null)
-                               throw new IllegalStateException(
-                                               "An SPDX license id must have beend defined for " + jarDir + " at this stage.");
+                       if (spdxLicenseId == null) {
+                               if (jarDir.getFileName().toString().startsWith("com.sun.jna"))
+                                       spdxLicenseId = "Apache-2.0 OR LGPL-2.1";
+                               else
+                                       throw new IllegalStateException(
+                                                       "An SPDX license id must have beend defined for " + jarDir + " at this stage.");
+                       }
                        writer.append("\nIt is redistributed under the following license:\n\n");
                        writer.append("SPDX-Identifier: " + spdxLicenseId + "\n\n");