Skip to content

Commit 487d4a6

Browse files
committed
fix: Remove incorrect maven repo resolving logic, using default location instead
1 parent 0a10ba7 commit 487d4a6

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/main/java/me/coley/recaf/util/MavenUtil.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
import java.nio.file.Path;
77
import java.nio.file.Paths;
88

9-
import static java.io.File.*;
9+
import static java.io.File.separator;
10+
import static java.io.File.separatorChar;
1011

1112
/**
1213
* Utilities for finding maven artifacts. The alternative is a 16 megabyte dependency bloat...
@@ -168,16 +169,6 @@ public static Path getLocalArtifactUrl(String groupId, String artifactId, String
168169
* @return Local directory containing downloaded maven artifacts.
169170
*/
170171
public static Path getMavenHome() {
171-
// Check if set by environment variables.
172-
// https://stackoverflow.com/questions/26609922/maven-home-mvn-home-or-m2-home
173-
String maven = System.getenv("M2_HOME");
174-
if (maven == null) {
175-
maven = System.getenv("MAVEN_HOME");
176-
}
177-
if(maven != null && !maven.isEmpty()) {
178-
return Paths.get(maven);
179-
}
180-
// Should be here
181172
return Paths.get(System.getProperty("user.home"), ".m2", "repository");
182173
}
183174
}

0 commit comments

Comments
 (0)