Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-6648

'mavenrc_pre' script does not receive arguments like mavenrc in Bourne shell does

    XMLWordPrintableJSON

    Details

      Description

      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 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):

      if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd %*"
      

      It's allow any user customization, using Maven standards.

      If relevant, I can provide PR.
      Best regards

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                michael-o Michael Osipov
                Reporter:
                axel3rd Alix Lourme
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: