* Subdirectory of the jar file where origin informations (changes, legal
* notices etc. are stored)
*/
* Subdirectory of the jar file where origin informations (changes, legal
* notices etc. are stored)
*/
/**
* Name of the file at the root of the repackaged jar, which prominently
* notifies that the component has be repackaged.
/**
* Name of the file at the root of the repackaged jar, which prominently
* notifies that the component has be repackaged.
.resolve(artifact.getArtifactId()).resolve("MANIFEST.MF");
Files.createDirectories(originalManifest.getParent());
try (OutputStream out = Files.newOutputStream(originalManifest)) {
.resolve(artifact.getArtifactId()).resolve("MANIFEST.MF");
Files.createDirectories(originalManifest.getParent());
try (OutputStream out = Files.newOutputStream(originalManifest)) {
|| entry.getName().endsWith("LICENSE") || entry.getName().endsWith("LICENSE.md")
|| entry.getName().endsWith("LICENSE-notice.md") || entry.getName().endsWith("COPYING")
|| entry.getName().endsWith("COPYING.LESSER")) {
|| entry.getName().endsWith("LICENSE") || entry.getName().endsWith("LICENSE.md")
|| entry.getName().endsWith("LICENSE-notice.md") || entry.getName().endsWith("COPYING")
|| entry.getName().endsWith("COPYING.LESSER")) {
.resolve(artifact.getArtifactId());
Path target = artifactOriginDir.resolve(entry.getName());
Files.createDirectories(target.getParent());
.resolve(artifact.getArtifactId());
Path target = artifactOriginDir.resolve(entry.getName());
Files.createDirectories(target.getParent());
Files.createDirectories(originalManifest.getParent());
try (OutputStream out = Files.newOutputStream(originalManifest)) {
sourceManifest.write(out);
Files.createDirectories(originalManifest.getParent());
try (OutputStream out = Files.newOutputStream(originalManifest)) {
sourceManifest.write(out);
spdxLicenceId = "GPL-2.0-only WITH Classpath-exception-2.0";
if (bundleDirName.startsWith("javax.inject."))
spdxLicenceId = "Apache-2.0";
spdxLicenceId = "GPL-2.0-only WITH Classpath-exception-2.0";
if (bundleDirName.startsWith("javax.inject."))
spdxLicenceId = "Apache-2.0";
manifest.getMainAttributes().putValue(SPDX_LICENSE_IDENTIFIER.toString(), spdxLicenceId);
if (!licensesUsed.containsKey(spdxLicenceId))
manifest.getMainAttributes().putValue(SPDX_LICENSE_IDENTIFIER.toString(), spdxLicenceId);
if (!licensesUsed.containsKey(spdxLicenceId))
String m2Repo = manifest.getMainAttributes().getValue(ARGEO_ORIGIN_M2_REPO.toString());
String originDesc = manifest.getMainAttributes().getValue(ARGEO_ORIGIN_M2.toString());
if (originDesc != null)
String m2Repo = manifest.getMainAttributes().getValue(ARGEO_ORIGIN_M2_REPO.toString());
String originDesc = manifest.getMainAttributes().getValue(ARGEO_ORIGIN_M2.toString());
if (originDesc != null)
- writer.append("The original component has M2 coordinates " + originDesc.replace(',', '\n') + "\n"
- + (m2Repo != null ? "\nin M2 repository" + m2Repo : "") + ".\n");
- else
+ writer.append("The original component has M2 coordinates:\n" + originDesc.replace(',', '\n') + "\n"
+ + (m2Repo != null ? "\nin M2 repository " + m2Repo + "\n" : ""));
+ else {
- if (originDesc != null)
- writer.append("The original component comes from " + originDesc + ".\n");
- else
- logger.log(ERROR, "Cannot find origin information in " + jarDir);
+ if (originDesc != null)
+ writer.append("The original component comes from " + originDesc + ".\n");
+ else
+ logger.log(ERROR, "Cannot find origin information in " + jarDir);
+ }
writer.append("\nA detailed list of changes is available under " + CHANGES + ".\n");
if (!jarDir.getFileName().endsWith(".src")) {// binary archive
writer.append("\nA detailed list of changes is available under " + CHANGES + ".\n");
if (!jarDir.getFileName().endsWith(".src")) {// binary archive