Deal with missing sources
[cc0/argeo-build.git] / src / org / argeo / build / Repackage.java
index 38f8e3f79343c99ca0b393bead854bff6b3ee851..7aa26b9756811e027a5c7bc44d23fbfa70d071d1 100644 (file)
@@ -507,11 +507,15 @@ public class Repackage {
                        throws IOException {
                if (sourceBundles)
                        return;
-               M2Artifact sourcesArtifact = new M2Artifact(artifact.toM2Coordinates(), "sources");
-               URL sourcesUrl = M2ConventionsUtils.mavenRepoUrl(repoStr, sourcesArtifact);
-               Path sourcesDownloaded = download(sourcesUrl, originBase, artifact, true);
-               processM2SourceJar(sourcesDownloaded, targetBundleDir);
-               logger.log(Level.TRACE, () -> "Processed source " + sourcesDownloaded);
+               try {
+                       M2Artifact sourcesArtifact = new M2Artifact(artifact.toM2Coordinates(), "sources");
+                       URL sourcesUrl = M2ConventionsUtils.mavenRepoUrl(repoStr, sourcesArtifact);
+                       Path sourcesDownloaded = download(sourcesUrl, originBase, artifact, true);
+                       processM2SourceJar(sourcesDownloaded, targetBundleDir);
+                       logger.log(Level.TRACE, () -> "Processed source " + sourcesDownloaded);
+               } catch (Exception e) {
+                       logger.log(Level.ERROR, () -> "Cannot download source for  " + artifact);
+               }
 
        }