Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declarative support for java -jar processes #17

Open
lukasito opened this issue Feb 27, 2019 · 1 comment
Open

Declarative support for java -jar processes #17

lukasito opened this issue Feb 27, 2019 · 1 comment

Comments

@lukasito
Copy link

Currently workaround for this is to use ExecFork task and use it as follows:

  executable = Jvm.current().javaExecutable.absolutePath
  args = ["-DsomeJvmArg=something", "-jar", "$buildDir/libs/some-fat-jar.jar"]
  waitForPort = 30000
  stopAfter = xyz
  ...

Problem with this approach is that you need to keep in mind the proper ordering of args (e.g. -D args before -jar arg. or -javaagent arg order etc.)

Proposal is to enhance JavaExecFork to support running java application declaratively e.g.

  jarFile = "$buildDir/libs/some-fat-jar.jar"
  javaagent = "$buildDir/agent/some-agent.jar" //optional or can be moved  to jvmArgs
  jvmArgs = [ '-Dconfig.file=src/main/resources/some.conf' ]
  waitForPort = 30000
  stopAfter = xyz
  ...
@lukasito lukasito changed the title Support for declaring java -jar processes declaratively Declarative support for java -jar processes Feb 27, 2019
@ultraon
Copy link

ultraon commented Sep 7, 2021

My build.gradle script couldn't resolve executable = Jvm.current().getJavaExecutable().getAbsolutePath(), so I added a full path like executable = org.gradle.internal.jvm.Jvm.current().getJavaExecutable().getAbsolutePath() and it works!

Thank you @lukasito for the workaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants