Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

equivalent for argLine from Maven Surefire plugin configuration #219

Closed
enzocardeal opened this issue Apr 26, 2023 · 2 comments
Closed

equivalent for argLine from Maven Surefire plugin configuration #219

enzocardeal opened this issue Apr 26, 2023 · 2 comments

Comments

@enzocardeal
Copy link

enzocardeal commented Apr 26, 2023

Hi,

I saw here #198 that mvn:fuzz runs a different plugin than Surefire.

For testing my application, it depends on --add-opens arguments for running properly. The problem is that on the pom.xml it is passed by argLine on Surefire configuration as follows:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.2</version>
        <configuration>
           <useFile>false</useFile>
           <argLine>
             --add-opens jdk.httpserver/com.sun.net.httpserver=ALL-UNNAMED
             --add-opens java.base/java.lang=ALL-UNNAMED
           </argLine>
        </configuration>
      </plugin>

Is there an alternative way that I can pass it so jqf-plugin will pick it up?

Thanks!

@rohanpadhye
Copy link
Owner

As I mentioned in #198, I don't know of any way for Maven plugins to inherit each other (do let me know if you have an idea). You will have to configure JQF separately from Surefire.

For the specific use case of command-line arguments: JQF does not start up new JVMs unlike Surefire, so you can't provide these args in an XML file. By the time the JQF plugin is loaded, the JVM is already up. So, if you want to provide command-line args to the JVM, you have to do it outside the plugin config. The best way to do so is to set the MAVEN_OPTS environment variable, which gets passed on the JVM that starts with the mvn command. See docs here: https://maven.apache.org/configure.html

@enzocardeal
Copy link
Author

Thank you for your swift response.

With the help of the docs you sent, I ended up using a .mvn/jvm.config file for those args.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants