Skip to content

Commit

Permalink
Limit the system properties that RunCommandProcessor uses
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand committed Apr 25, 2024
1 parent 1eaecd6 commit 9e6ddc6
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.pkg.PackageConfig;
import io.quarkus.deployment.pkg.builditem.BuildSystemTargetBuildItem;
import io.quarkus.deployment.pkg.builditem.LegacyJarRequiredBuildItem;
import io.quarkus.deployment.pkg.builditem.OutputTargetBuildItem;
import io.quarkus.deployment.pkg.builditem.UberJarRequiredBuildItem;
Expand All @@ -32,7 +33,8 @@ public void defaultJavaCommand(PackageConfig packageConfig,
OutputTargetBuildItem jar,
List<UberJarRequiredBuildItem> uberJarRequired,
List<LegacyJarRequiredBuildItem> legacyJarRequired,
BuildProducer<RunCommandActionBuildItem> cmds) {
BuildProducer<RunCommandActionBuildItem> cmds,
BuildSystemTargetBuildItem buildSystemTarget) {

Path jarPath = null;
if (legacyJarRequired.isEmpty() && (!uberJarRequired.isEmpty()
Expand All @@ -52,7 +54,7 @@ public void defaultJavaCommand(PackageConfig packageConfig,
List<String> args = new ArrayList<>();
args.add(determineJavaPath());

for (Map.Entry<?, ?> e : System.getProperties().entrySet()) { //TODO: this is almost certainly wrong as it pulls in all the system properties Maven has set
for (Map.Entry<?, ?> e : buildSystemTarget.getBuildSystemProps().entrySet()) {
args.add("-D" + e.getKey().toString() + "=" + e.getValue().toString());
}
args.add("-jar");
Expand Down

0 comments on commit 9e6ddc6

Please sign in to comment.