if (nameVersion == null) {
// hack for weird issue with JNA jar in Eclipse
String[] arr_ = file.getFileName().toString().split("_");
+ ourSymbolicName = arr_[0];
String v = arr_[1].substring(0, arr_[1].length() - 4);// remove .jar
- nameVersion = new NameVersion(arr_[0], v);
+ entries.put(BUNDLE_VERSION.toString(), v);
+ nameVersion = new NameVersion(ourSymbolicName, v);
logger.log(WARNING, file + " has no symbolic name, trying " + nameVersion.getName() + "/"
+ nameVersion.getVersion() + " based on its name");
}
// license
String spdxLicenseId = SPDX_LICENSE_IDENTIFIER.get(mapping);
- if (spdxLicenseId == null)
- throw new IllegalStateException("An SPDX license id must have beend defined at this stage.");
+ if (spdxLicenseId == null) {
+ if (jarDir.getFileName().toString().startsWith("com.sun.jna")) // FIXME understand/report why JNA's
+ // jar is corrupted
+ spdxLicenseId = "LGPL-2.1-or-later OR Apache-2.0";
+ 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");