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

Define argLine property rather than setting it in surefire, to ease integration with other plugins #298

Closed
slanglois opened this issue Jun 4, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@slanglois
Copy link
Contributor

The parent pom of the SDK currently defines this:

       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>${maven.surefire.version}</version>
         <configuration>
             <argLine>${app.testing.jvm.args}</argLine>
         </configuration>
       </plugin>

This makes it impossible for other plugins to redefine this argLine setting.
My use case is the maven-jacoco-plugin, which adds a java agent on the command line to generate some code coverage.
The warning at the beginning of that page explains it very well.
It would be much more convenient not to configure this in the surefire plugin, but just defining the argLine property:

<argLine>-Xms256m -Xmx1524m -XX:MaxPermSize=256m -Duser.language=en</argLine>

(And by the way, this could be a nicer way to add the spring-loaded argument on the command line too...)

@mindthegab
Copy link
Contributor

I am not clear about this one.

Can be added at maven top level in the pom? i.e. applies to the JVM that runs maven or to a forked JVM?

Or you mean surefire.argLine?

Re spring-loaded, we tried a lot but since tomcat is not forked we were not able to pass parameters via Maven but we had to call maven with the agent. C

Can you elaborate a bit on this issue?

Moving to enhancement and post 2.1.1.

@slanglois
Copy link
Contributor Author

I mean that the argLine parameter should be defined as a property of the pom, rather than a configuration of surefire.

 <properties>
   <argLine>-Xms256m -Xmx1524m -XX:MaxPermSize=256m -Duser.language=en</argLine>
 </properties>
 ...
 <plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-surefire-plugin</artifactId>
   <configuration>
     <!-- Do not define argLine here! -->
   </configuration>
 </plugin>

This has the same effect, but allows other plugins - such as JaCoCo - to alter this value.

slanglois pushed a commit that referenced this issue Sep 16, 2015
Allows other plugins (such as JaCoCo) to tune the argLine parameters of the JVM forked by surefire
@ohej ohej modified the milestones: 2.1.1, Future Version Sep 24, 2015
@gravitonian gravitonian assigned gravitonian and unassigned slanglois Oct 7, 2015
gravitonian pushed a commit that referenced this issue Oct 7, 2015
@ohej ohej added bug and removed enhancement labels Oct 19, 2015
gravitonian pushed a commit that referenced this issue Feb 29, 2016
#298 Define argLine as a property, not in surefire
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants