Skip to content

Commit 64f4ec2

Browse files
committed
Revert "Add support to read classpath from the CLASSPATH environment variable (#256)"
This reverts commit f8e17d4.
1 parent 6bdf114 commit 64f4ec2

File tree

3 files changed

+0
-26
lines changed

3 files changed

+0
-26
lines changed

pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,6 @@
160160
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
161161
--add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
162162
</argLine>
163-
<environmentVariables>
164-
<!-- used by InferConfigTest.java -->
165-
<CLASSPATH>src/test/examples/home-dir/.m2/repository/com/external/external-library/1.1/external-library-1.1.jar</CLASSPATH>
166-
</environmentVariables>
167163
</configuration>
168164
</plugin>
169165
<!-- Copy dependencies to dist -->

src/main/java/org/javacs/InferConfig.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import java.nio.file.Path;
1111
import java.nio.file.Paths;
1212
import java.util.*;
13-
import java.util.stream.*;
1413
import java.util.logging.Logger;
1514
import java.util.regex.Pattern;
1615
import java.util.stream.Stream;
@@ -79,14 +78,6 @@ Set<Path> classPath() {
7978
return bazelClasspath(bazelWorkspaceRoot);
8079
}
8180

82-
var classpathEnvVar = System.getenv("CLASSPATH");
83-
LOG.fine(() -> "CLASSPATH=" + classpathEnvVar);
84-
if (classpathEnvVar != null) {
85-
var paths = Stream.of(classpathEnvVar.split(System.getProperty("path.separator"))).map(Path::of).collect(Collectors.toSet());
86-
LOG.fine(() -> "Paths from CLASSPATH = " + paths);
87-
return paths;
88-
}
89-
9081
return Collections.emptySet();
9182
}
9283

src/test/java/org/javacs/InferConfigTest.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ public class InferConfigTest {
1616
private InferConfig both = new InferConfig(workspaceRoot, externalDependencies, mavenHome, gradleHome);
1717
private InferConfig gradle = new InferConfig(workspaceRoot, externalDependencies, Paths.get("nowhere"), gradleHome);
1818
private InferConfig thisProject = new InferConfig(Paths.get("."), Set.of());
19-
private InferConfig simpleProject = new InferConfig(Paths.get("src/test/examples/simple-project"), Set.of());
2019

2120
@Test
2221
public void mavenClassPath() {
@@ -36,18 +35,6 @@ public void gradleClasspath() {
3635
// v1.1 should be ignored
3736
}
3837

39-
@Test
40-
public void envVarClasspath() {
41-
// CLASSPATH is set in pom.xml
42-
assertThat(
43-
simpleProject.classPath(),
44-
contains(mavenHome.resolve("repository/com/external/external-library/1.1/external-library-1.1.jar")));
45-
assertThat(
46-
both.classPath(),
47-
not(contains(mavenHome.resolve("repository/com/external/external-library/1.1/external-library-1.1.jar"))));
48-
}
49-
50-
5138
@Test
5239
public void mavenDocPath() {
5340
assertThat(

0 commit comments

Comments
 (0)