Skip to content

Commit a7d2b4b

Browse files
committed
Changed Maven to operate in online mode, and added necessary dependencies for online mode. Fixes #2160
1 parent 8ef2e58 commit a7d2b4b

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,16 @@
553553
<artifactId>maven-core</artifactId>
554554
<version>${maven-version}</version>
555555
</dependency>
556+
<dependency>
557+
<groupId>org.apache.maven.resolver</groupId>
558+
<artifactId>maven-resolver-transport-http</artifactId>
559+
<version>1.9.22</version>
560+
</dependency>
561+
<dependency>
562+
<groupId>org.apache.maven.resolver</groupId>
563+
<artifactId>maven-resolver-connector-basic</artifactId>
564+
<version>1.9.22</version>
565+
</dependency>
556566
</dependencies>
557567
<profiles>
558568
<profile>

src/org/rascalmpl/library/util/PathConfig.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -779,13 +779,8 @@ private static ISourceLocation getPomXmlLocation(ISourceLocation project) {
779779
*/
780780
private static IList getPomXmlCompilerClasspath(ISourceLocation manifestRoot) {
781781
try {
782-
String mavenDependencyPlugin = "org.apache.maven.plugins:maven-dependency-plugin:3.8.0";
783-
// First, make sure that maven-dependency-plugin is downloaded when not available
784-
Maven.runCommand(List.of(mavenDependencyPlugin + ":do-nothing"), manifestRoot);
785-
786-
// Now, actually let maven build the classpath. Note that this is in offline mode as to not download any dependencies
787782
var tempFile = Maven.getTempFile("classpath");
788-
var mavenOutput = Maven.runCommand(List.of("-o", mavenDependencyPlugin + ":build-classpath", "-DincludeScope=compile", "-Dmdep.outputFile=" + tempFile.toString()), manifestRoot, tempFile);
783+
var mavenOutput = Maven.runCommand(List.of("--quiet", "org.apache.maven.plugins:maven-dependency-plugin:3.8.1:build-classpath", "-DincludeScope=compile", "-Dmdep.outputFile=" + tempFile.toString()), manifestRoot, tempFile);
789784

790785
// The classpath will be written to the temp file on a single line
791786
return Arrays.stream(mavenOutput.get(0).split(File.pathSeparator))

0 commit comments

Comments
 (0)