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

Set MAVEN_CMD_LINE_ARGS env #1008

Closed
gsmet opened this issue Jun 5, 2024 · 2 comments
Closed

Set MAVEN_CMD_LINE_ARGS env #1008

gsmet opened this issue Jun 5, 2024 · 2 comments

Comments

@gsmet
Copy link

gsmet commented Jun 5, 2024

First, thanks for this amazing project, it makes my Quarkus builds a lot faster.

When using vanilla Maven, MAVEN_CMD_LINE_ARGS is set to whatever the Maven command line is.

This allows you to inspect the Maven command line in extensions (for instance a Develocity extension).

Unfortunately, mvnd doesn't set this environment variable and I couldn't find an easy (and reliable) way to get the command line in a way that wouldn't get cluttered with a lot of non relevant arguments (i.e. I don't want to use ProcessHandle.current().info().commandLine()).

Would it be possible to mimic the Maven behavior (ideally) or expose it in some easily consumable way?

For a use case, see https://github.com/quarkusio/quarkus-project-develocity-extension/blob/fa6fa13df7b56c31d6ba71b2b60017a5d827c8fb/src/main/java/io/quarkus/develocity/project/QuarkusProjectDevelocityConfigurationListener.java#L96 .

Note that I might have missed something obvious but I inspected System.getenv() and System.getProperties() to no avail.

gsmet added a commit to gsmet/quarkus-project-develocity-extension that referenced this issue Jun 5, 2024
gsmet added a commit to gsmet/quarkus-project-develocity-extension that referenced this issue Jun 5, 2024
@gnodet
Copy link
Contributor

gnodet commented Jun 5, 2024

Hey Guillaume, I'm not completely sure about this one.
I suppose it could be added back in the mvnd branch supporting Maven 3.x, but that environment variable has been removed in 4.x (see https://issues.apache.org/jira/browse/MNG-7192). You may want to raise a JIRA issue for 4.x explaining your use case so that a better solution can be found.

@gsmet
Copy link
Author

gsmet commented Jun 7, 2024

Thanks for the answer. Let's close this one. I'll see if there are any other alternatives.

@gsmet gsmet closed this as completed Jun 7, 2024
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

No branches or pull requests

2 participants