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

Use Java Process API to launch Axon Ivy Engine #476

Merged
merged 1 commit into from
Jul 31, 2024
Merged

Conversation

alexsuter
Copy link
Member

  • No longer need commons.exec
  • No need to SIGKILL engine in tests which occurs in side-effects on windows and ugly errors in build log

Jenkinsfile Show resolved Hide resolved
@ivy-rew
Copy link
Member

ivy-rew commented Jul 30, 2024

sounds great 🎸

@@ -133,7 +134,10 @@ private ProcessBuilder toProcessBuilder(Command command) {
cmds.add("-Dosgi.install.area=" + osgiDir.toAbsolutePath());

if (StringUtils.isNotBlank(context.vmOptions.additionalVmOptions())) {
cmds.add(context.vmOptions.additionalVmOptions()); // todo no escape
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @ivy-rew

I've one issue here. The additionalVmOptions were passed unescaped to commons.exec as one-liner. This is not possible with Java Process API.

A quick-dirty hack which might not work for all uses cases is to split them by whitespace, but I think the real solution would be to change additionalVmOptions from a one-liner to a List.

You see such a pattern also in other plugins:
https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#compilerArgs

What do you think should we go with this solution, which works at least for engine-integration-test or should I already introduce a new one and deprecate the old one? And implement the old one with this approach?

Copy link
Member

@ivy-rew ivy-rew Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I would definitively support a real list argument type, just like we also do to configure JDT: https://axonivy.github.io/project-build-plugin/release/11.3/compileProject-mojo.html#compilerOptions

And another yes, I'd deprecate the old parameter and make it work by analysing whitespaces ... or maybe glean some code from commons.exec that did this logic. Though I do not think it's worth to investigate a lot into this backward compatibility ... I think these parameters have rarely been configured in projects.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I will make a new PR for this.

- No longer need commons.exec
- No need to SIGKILL engine in tests which occurs in side-effects on windows and ugly errors in build log
@alexsuter alexsuter merged commit b38516f into master Jul 31, 2024
2 of 3 checks passed
@alexsuter alexsuter deleted the process-api branch July 31, 2024 06:33
@alexsuter
Copy link
Member Author

fyi @ivy-cst

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

Successfully merging this pull request may close these issues.

2 participants