GithubHelp home page GithubHelp logo

Comments (4)

pzygielo avatar pzygielo commented on August 25, 2024 1

This works for me

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>java</executable>
              <arguments>
                <argument>--enable-preview</argument>
                <argument>MyClass</argument>
                <argument>a</argument>
                <argument>b</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>

Not sure which java recognizes --release switch - mine don't.

from exec-maven-plugin.

pzygielo avatar pzygielo commented on August 25, 2024

Do you mean that using arguments, commandlineArgs for that purpose is not possible?

from exec-maven-plugin.

homberghp avatar homberghp commented on August 25, 2024

Maybe it is my misunderstanding, but from the doc and the source code I infer that the command line arguments are passed to the program, as the args to public static void main(String[] args);
The effect I am looking for is java ${jvmArgs} com.example.Main ${commandLineArgs},
such that this can expand to e.g. java --release 19 --enable-preview com.example.Main Hello John, where --release 19
and --enable-preview are jvmArgs and Hello John are commandlineArgs

from exec-maven-plugin.

andirady avatar andirady commented on August 25, 2024

You can set the JVM args using MAVEN_OPTS environment variable. It's stated in the docs for the systemProperties properties: "A list of system properties to be passed. Note: as the execution is not forked, some system properties required by the JVM cannot be passed here. Use MAVEN_OPTS or the exec:exec instead. See the user guide for more information."

from exec-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.