Maven: Overview for the values of Maven properties
Solution 1:
As a workaround, add this to the <plugins> ... </plugins>
section inside your project's pom.xml
:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echoproperties />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
Now execute mvn validate
.
On the console, prefixed with [echoproperties]
, there will be the full list of system properties, including those set by Maven such as project.build.outputDirectory
, basedir
, and settings.localRepository
.
Solution 2:
Not sure if helps, but I found this when trying to do the same thing:
mvn com.github.ekryd.echo-maven-plugin:echo-maven-plugin:echo -Decho.message='${project.build.testOutputDirectory}'
From here.
Adding the following to ${user.home}/.m2/settings.xml
:
<pluginGroups>
<pluginGroup>com.github.ekryd.echo-maven-plugin</pluginGroup>
</pluginGroups>
the command can be shortened to:
mvn echo:echo -Decho.message='${project.build.testOutputDirectory}'
Solution 3:
I don't know how to get them "officially", but here is a workaround. Add maven-antrun-plugin
to your project and run mvn test -X
. The plugin will show all properties passed to it from Maven. The list looks complete to me.