Passing JVM arguments to Maven Surefire Plugin

I was working on a Maven build a while back and was trying to figure out how to pass a JVM argument to the Maven Surefire plugin. We needed this capability in order to tell the underlying framework to not attempt to perform a JNDI lookup for its datasource and instead to use a DriverManager. I came across this little gem and thought I would share.

<build>
 <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-DSTANDALONE_DATASOURCE=true</argLine>
</configuration>
</plugin>
 </plugins>
</build>

Advertisements
This entry was posted in Java, Maven and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s