Add Maven repo parameter to Opal main
@@ -38,7 +38,7 @@ import picocli.CommandLine;
@CommandLine.Command(name = "JavaCGOpal")
public class Main implements Runnable {
- private static Logger logger = LoggerFactory.getLogger(Main.class);
+ private static final Logger logger = LoggerFactory.getLogger(Main.class);
@CommandLine.ArgGroup(exclusive = true, multiplicity = "1")
Commands commands;
@@ -62,11 +62,18 @@ public class Main implements Runnable {
description = "Artifact, maven coordinate or file path")
String artifact;
+ @CommandLine.Option(names = {"-r"},
+ paramLabel = "REPOS",
+ description = "Maven repositories",
+ split = ",")
+ List<String> repos;
+
@CommandLine.Option(names = {"-t", "--timestamp"},
paramLabel = "TS",
description = "Release TS",
defaultValue = "0")
String timestamp;
+
@CommandLine.Option(names = {"-m", "--mode"},
paramLabel = "MODE",
description = "Input of algorithms are {FILE or COORD}",
@@ -247,7 +254,11 @@ public class Main implements Runnable {
final var result = new ArrayList<MavenCoordinate>();
if (this.commands.computations.tools.merge.dependencies != null) {
for (String currentCoordinate : this.commands.computations.tools.merge.dependencies) {
- result.add(MavenCoordinate.fromString(currentCoordinate));
+ var coordinate = MavenCoordinate.fromString(currentCoordinate);
+ if (this.commands.computations.repos != null) {
+ coordinate.setMavenRepos(this.commands.computations.repos);
+ }
+ result.add(coordinate);
}
}
return result;
@@ -265,6 +276,9 @@ public class Main implements Runnable {
MavenCoordinate result = null;
if (this.commands.computations.artifact != null) {
result = MavenCoordinate.fromString(this.commands.computations.artifact);
+ if (this.commands.computations.repos != null) {
+ result.setMavenRepos(this.commands.computations.repos);
+ }
}
return result;
}
