+ // Some proprietary or signed artifacts do not allow any modification
+ // When releasing (with separate sources), we just copy it
+ Path unmodifiedTarget = targetCategoryBase
+ .resolve(fileProps.getProperty(BUNDLE_SYMBOLICNAME.toString()) + "." + artifact.getBranch() + ".jar");
+ Files.createDirectories(unmodifiedTarget.getParent());
+ Files.copy(downloaded, unmodifiedTarget, StandardCopyOption.REPLACE_EXISTING);
+ Path bundleDir = targetCategoryBase
+ .resolve(fileProps.getProperty(BUNDLE_SYMBOLICNAME.toString()) + "." + artifact.getBranch());
+ downloadAndProcessM2Sources(fileProps, artifact, bundleDir, false, true);
+ Manifest manifest;
+ try (JarInputStream jarIn = new JarInputStream(Files.newInputStream(unmodifiedTarget))) {
+ manifest = jarIn.getManifest();
+ }
+ createSourceJar(bundleDir, manifest, fileProps);
+ }
+
+ /** Download and integrates sources for a single Maven artifact. */
+ void downloadAndProcessM2Sources(Properties props, M2Artifact artifact, Path targetBundleDir, boolean merging,
+ boolean unmodified) throws IOException {