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

Maven cmd does errors out when "MAVEN_OPTS=-V"

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • None
    • None
    • None
    • None

    Description

      As a user, I want to see the Maven version banner every time, so on Windows, I "set MAVEN_OPTS=-V" which fails Maven on the next invocation with this error:

      Unrecognized option: -V
      Error: Could not create the Java Virtual Machine.
      Error: A fatal exception has occurred. Program will exit. 

       

      Attachments

        Issue Links

          Activity

            According to the documentation, the MAVEN_OPTS environment variable holds

            parameters used to start up the JVM running Maven

            So the -V gets passed to the JVM rather than to Maven; the JVM does not recognise that flag and hence exits.

            Although not what you're looking for, the behaviour is expected as far as I can tell.

            mthmulders Maarten Mulders added a comment - According to the documentation , the MAVEN_OPTS environment variable holds parameters used to start up the JVM running Maven So the -V gets passed to the JVM rather than to Maven; the JVM does not recognise that flag and hence exits. Although not what you're looking for, the behaviour is expected as far as I can tell.
            michael-o Michael Osipov added a comment -

            Agree here...

            michael-o Michael Osipov added a comment - Agree here...

            Well, that's a pain (for me), it feels like the env var is misnamed but it's too late to change.

            It would be nice to have a MAVEN_OPTS and MAVEN_JVM_OPTS, but maybe we could add instead a MAVEN_CLI_OPTS?

            ggregory Gary D. Gregory added a comment - Well, that's a pain (for me), it feels like the env var is misnamed but it's too late to change. It would be nice to have a MAVEN_OPTS and MAVEN_JVM_OPTS, but maybe we could add instead a MAVEN_CLI_OPTS?
            michael-o Michael Osipov added a comment -

            Well, it's like CATALINA_OPTS. Maybe it would rather be MAVEN_JAVA_OPTS...?

            michael-o Michael Osipov added a comment - Well, it's like CATALINA_OPTS . Maybe it would rather be MAVEN_JAVA_OPTS ...?

            Sure, at this point, I'll take it

            ggregory Gary D. Gregory added a comment - Sure, at this point, I'll take it
            michael-o Michael Osipov added a comment -

            mthmulders, why don't we introduce MAVEN_ARGS?

            michael-o Michael Osipov added a comment - mthmulders , why don't we introduce MAVEN_ARGS ?
            michael-o Michael Osipov added a comment -

            Please see MNG-7193. It will solve your problem. I am intentionally closing this ticket because it cannot solved the way as reported.

            michael-o Michael Osipov added a comment - Please see MNG-7193 . It will solve your problem. I am intentionally closing this ticket because it cannot solved the way as reported.

            Ok, ty.

            ggregory Gary D. Gregory added a comment - Ok, ty.
            michael-o Michael Osipov added a comment - - edited

            ggregory, your problem should now be fixed with MNG-7193.

            michael-o Michael Osipov added a comment - - edited ggregory , your problem should now be fixed with MNG-7193 .

            michael-o , thanks for the good news. This is for a future 4.0.0 only right?

             

            ggregory Gary D. Gregory added a comment - michael-o , thanks for the good news. This is for a future 4.0.0 only right?  
            michael-o Michael Osipov added a comment - - edited

            ggregory, for now yes. We need to discuss on dev@ whether all the startup scripts improvements I have done should be backported to 3.9 or some 3.10. If you need this I would recommend to start a discussion after the holidays. I don't object backporting, but everyone should know the price for this.

            michael-o Michael Osipov added a comment - - edited ggregory , for now yes. We need to discuss on dev@ whether all the startup scripts improvements I have done should be backported to 3.9 or some 3.10. If you need this I would recommend to start a discussion after the holidays. I don't object backporting, but everyone should know the price for this.

            People

              Unassigned Unassigned
              ggregory Gary D. Gregory
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: