[
https://issues.apache.org/jira/browse/MNG-6648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16827605#comment-16827605
]
Alix Lourme commented on MNG-6648:
----------------------------------
Hello [~khmarbaise],
As my understanding, the toolchains can customize the JDK/JRE used by plugins
(javac for compiler, ...), but not the JRE used at runtime for Maven, and
oblige to update the pom.
My use case is to customize the Maven runtime JRE by command line parameter
(some rare plugins could again have a behavior linked to Maven runtime JRE),
allowing to switch this JRE simply by project (it is for corner-case use-case,
but it's exist when you develop on very-old and new projects).
In addition, it could help to upgrade Maven version when you have some
historical wrapper to achieve "by project behavior" by parameters on command
line (coming from Maven 2 usage and custom Java version & memory settings needs
by project behavior ; when per-project features doesn't exist, implemented in
3.3).
So interpret command lines parameters to check/verify/enforce custom items and
back to Maven standards configuration could be helpful, feasible by design withÂ
{{mavenrc_pre}} if commande line parameters are passed to this script.
Best regards
> Add command line parameters in 'mavenrc_pre' script
> ---------------------------------------------------
>
> Key: MNG-6648
> URL: https://issues.apache.org/jira/browse/MNG-6648
> Project: Maven
> Issue Type: Improvement
> Components: Command Line
> Affects Versions: 3.6.0, 3.6.1
> Reporter: Alix Lourme
> Priority: Major
> Labels: command-line, script
> Fix For: waiting-for-feedback
>
>
> Hello,
> In some corner-case, you could have to run Maven with a custom {{JAVA_HOME}}
> (JDK v8, v11, ... even if it is evil some plugin can be impacted by JDK at
> runtime).
> If it is per-project, [JVM and Command Line
> Options|https://maven.apache.org/docs/3.3.1/release-notes.html#JVM_and_Command_Line_Options]
> is not relevant and update {{JAVA_HOME}} each time in your environment could
> be boring.
> A command line user-custom-parameter (ex : {{-Dmy.jdk=11}}) could be simple
> to achieve that.
> A Maven script wrapper could be implemented for that, but it's like update
> the Maven distribution => evil.
> The *mavenrc_pre* (MNGSITE-246) could be perfect for that feature !
> But currently command line parameters are not used in script :(.
> If parameters are used dor script call, sample for {{mvn.cmd}} (windows):
> {code}
> if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd
> %*"
> {code}
> It's allow any user customization, using Maven standards.
> If relevant, I can provide PR.
> Best regards
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)