Skip duplicate NOTICE when merging
[cc0/argeo-build.git] / src / org / argeo / build / Repackage.java
index b4b95c1d33fe7c5b5f253edc34bfbc3e23285266..d90375e3f442aae12b868223e82b52024c1566a5 100644 (file)
@@ -584,6 +584,10 @@ public class Repackage {
                                                } else if (entry.getName().startsWith("org/apache/batik/")) {
                                                        logger.log(TRACE, "Skip " + entry.getName());
                                                        continue entries;
+                                               } else if (entry.getName().startsWith("META-INF/NOTICE")) {
+                                                       logger.log(TRACE, "Skip " + entry.getName());
+                                                       // TODO merge them?
+                                                       continue entries;
                                                } else {
                                                        throw new IllegalStateException("File " + target + " from " + artifact + " already exists");
                                                }
@@ -752,8 +756,6 @@ public class Repackage {
                        URL sourcesUrl = alternateUri != null ? new URL(alternateUri)
                                        : M2ConventionsUtils.mavenRepoUrl(repoStr, sourcesArtifact);
                        Path sourcesDownloaded = downloadMaven(sourcesUrl, sourcesArtifact);
-                       if (!props.containsKey(ARGEO_ORIGIN_SOURCES_URI.toString()))
-                               ARGEO_ORIGIN_SOURCES_URI.put(props, sourcesUrl.toString());
                        processM2SourceJar(sourcesDownloaded, targetBundleDir, merging ? artifact : null, unmodified);
                        logger.log(TRACE, () -> "Processed source " + sourcesDownloaded);
                } catch (Exception e) {