Skip to content

Commit

Permalink
Merge pull request #43555 from geoand/truffle-sysprop
Browse files Browse the repository at this point in the history
Truffle no longer needs the `java.class.path` sysprop
  • Loading branch information
geoand committed Sep 27, 2024
2 parents 259ffef + 401ef73 commit 825848d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
* This system property is used in rare by libraries (Truffle for example) to create their own ClassLoaders.
* The value of the system property is simply best effort, as there is no way to faithfully represent
* the Quarkus ClassLoader hierarchies in a system property value.
*
* @deprecated This was initially added to support Truffle, but it is no longer needed so the build item should not be used
*/
@Deprecated(forRemoval = true)
public final class SetClassPathSystemPropBuildItem extends MultiBuildItem {
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.util.List;
import java.util.stream.Stream;

import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.ExecutionTime;
import io.quarkus.deployment.annotations.Record;
Expand All @@ -15,17 +14,9 @@
import io.quarkus.maven.dependency.ResolvedDependency;
import io.quarkus.runtime.ClassPathSystemPropertyRecorder;

@SuppressWarnings("removal")
public class ClassPathSystemPropBuildStep {

@BuildStep
public void produce(BuildProducer<SetClassPathSystemPropBuildItem> producer, CurateOutcomeBuildItem curateOutcome) {
boolean truffleUsed = curateOutcome.getApplicationModel().getDependencies().stream()
.anyMatch(d -> d.getGroupId().equals("org.graalvm.polyglot"));
if (truffleUsed) {
producer.produce(new SetClassPathSystemPropBuildItem());
}
}

@BuildStep
@Record(ExecutionTime.STATIC_INIT)
public void set(List<SetClassPathSystemPropBuildItem> setCPItems,
Expand Down

0 comments on commit 825848d

Please sign in to comment.