Where is the list of Maven predefined properties

I know that there is a list of all Maven predefined properties (you know, like project.build.sourceEncoding or project.build.sourceDirectory ). I once saw a list, but I just can't find it again.

+80
maven
Dec 10 2018-10-10
source share
6 answers

Looking at "effective POM" will probably help too. For example, if you want to know the path for ${project.build.sourceDirectory}

you will find the appropriate XML in the effective POM, for example: <project> <build> <sourceDirectory>/my/path</sourceDirectory>

Also useful - you can evaluate properties in real time through the command line mvn help:evaluate , being in the same directory as the POM.

+19
Sep 03 '13 at 20:00
source share

Take a look at section 9.2 .: Maven Properties of the free Maven online book : full link .

+17
Jul 08 '15 at 8:29
source share

I think the best place to watch is Super POM .

As an example, at the time of writing, a linked link shows some properties between lines 32-48.

The interpretation of this is to follow XPath as a property . with delimiters.

So for example:

${project.build.testOutputDirectory} == ${project.build.directory}/test-classes

and

${project.build.directory} == ${project.basedir}/target

Thus, combining them, we find:

${project.build.testOutputDirectory} == ${project.basedir}/target/test-classes

(To refer to resource directories, see https://stackoverflow.com/a/166778/ )




 <project> <modelVersion>4.0.0</modelVersion> . . . <build> <directory>${project.basedir}/target</directory> <outputDirectory>${project.build.directory}/classes</outputDirectory> <finalName>${project.artifactId}-${project.version}</finalName> <testOutputDirectory>${project.build.directory}/test-classes</testOutputDirectory> <sourceDirectory>${project.basedir}/src/main/java</sourceDirectory> <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory> <testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory> <resources> <resource> <directory>${project.basedir}/src/main/resources</directory> </resource> </resources> <testResources> <testResource> <directory>${project.basedir}/src/test/resources</directory> </testResource> </testResources> . . . </build> . . . </project> 
+6
Aug 04 '15 at 9:30
source share

I was tired of seeing this page with its outdated links to non-existent Codehaus pages, so I asked the Maven Users mailing list and got more recent answers.

I would say that the best (and most authoritative) answer contained in my link above is the one contributed by HervΓ© BOUTEMY:

here is the main link: http://maven.apache.org/ref/3-LATEST/maven-model-builder/

it does not explain everything that can be found in the POM or in the settings, because there is so much information, but it points to the POM and parameter descriptors and explains everything that is not a POM or settings

+4
Sep 05 '15 at 19:22
source share

This link shows how to list all active properties: http://skillshared.blogspot.co.uk/2012/11/how-to-list-down-all-maven-available.html

In conclusion, add the following plugin definition to POM, then run mvn install :

 <plugin> <artifactId>maven-antrun-plugin</artifactId> <version>1.7</version> <executions> <execution> <phase>install</phase> <configuration> <target> <echoproperties /> </target> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> 
+1
05 Oct '16 at 11:33
source share



All Articles