You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Christoph Läubrich <ma...@laeubi-soft.de> on 2022/11/10 07:49:03 UTC
Access the maven commandline options from a plexus component?
Is it possible to access the commandline options I pass to maven in a
plexus component?
I'm especially interested in the -V option because I want this to
trigger printing the version of my core-extension as well
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Access the maven commandline options from a plexus component?
Posted by Robert Scholte <rf...@apache.org>.
Key code is here:
https://github.com/apache/maven/blob/master/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java#L1367-L1431
The CliRequest contains all the original arguments,
MavenExecutionRequest transforms these values and can be accessed via
MavenSession.
I don't see anything related to showVersion.
If you have a good argument why you need it later, you can provide a PR
where the MavenExecutionRequest is extended with boolean showVersion()
thanks,
Robert
------ Oorspronkelijke bericht ------
Van "Christoph Läubrich" <ma...@laeubi-soft.de>
Aan "Maven Developers List" <de...@maven.apache.org>
Datum 10-11-2022 08:49:03
Onderwerp Access the maven commandline options from a plexus component?
>Is it possible to access the commandline options I pass to maven in a plexus component?
>
>I'm especially interested in the -V option because I want this to trigger printing the version of my core-extension as well
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org