Environment, Ant & Maven Variables

I wanted to confirm my build environment but wasn’t sure how to catch everything.

Turns out there is a <echoproperties /> tag/task in ant that when used within the maven-antrun-plugin will tell you just about everything you need to know.

Add the following to your pom.xml and run a clean on your project:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>build-environment</id>
<phase>pre-clean</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<property environment="env" />
<echoproperties />
</target>
</configuration>
</execution>
</executions>
</plugin>

Or for a more quick and dirty way to get your complete environment cd into your project directory and run:

mvn -X test

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