Maven Standard System Properties: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
=External=
* Maven Properties http://books.sonatype.com/mvnref-book/reference/resource-filtering-sect-properties.html
=Internal=
=Internal=


* [[Maven#Subjects|Maven]]
* [[Maven#Subjects|Maven]]
=Overview=
This is a list of available [[Maven_Concepts#Project_Properties|project properties]].


=Standard System Properties=
=Standard System Properties=


==project.basedir==
==Top-Level Properties==
 
===version===
 
See "[[#project.version|project.version]]" below.
 
==Project Properties==
 
When referencing a ${property.<name>} system property, that translates into an internal <tt>Model.get<Name>()</tt>, aimed at the project Model instance.
 
===project.groupId===
 
===project.artifactId===
 
===project.version===
 
See "[[#version|version]]" above.
 
===project.basedir===
 
===project.baseUri===
 
===project.name===
 
===project.description===
 
==Project Build Properties==
 
===project.build.finalName===
===project.build.directory===
===project.build.outputDirectory===
===project.build.sourceDirectory===
===project.build.testOutputDirectory===
 
==Project Parent Properties==
 
===project.parent.artifactId===
===project.parent.groupId===
===project.parent.version===
===project.parent.relativePath===
 
==Parent Properties==
 
===parent.relativePath===
 
 
==Maven Runtime Properties==
 
These properties are exposed via their <tt>refid</tt>, so they can be accessed externally, from Ant, for example, as follows:
 
<pre>
    ....
    <configuration>
        <tasks>
          <property name="maven.test.classpath" refid="maven.test.classpath"/>
    ...
</pre>
 
===maven.compile.classpath===
 
===maven.runtime.classpath===
 
===maven.test.classpath===
 
===maven.plugin.classpath===
 
=Organizatorium=
 
<font color=red>
 
==Exposed Directly==
 
These are directly accessible from Ant:
 
===basedir===
 
===project.basedir===
 
===project.build.directory===
 
===project.version===
 
!!!Inaccessible from Ant
 
{{project.version}}
 
 
For an example of how to forward this to Ant, see [Antrun plugin|MavenAntrunPlugin].
 
!!!Displaying Various Classpath Values at Runtime
 
Ant can be also used to display various classpath values at runtime, see how to do that also here: [Antrun plugin|MavenAntrunPlugin#DisplayingVariousClasspathValuesAtRuntime].
 


==project.build.directory==
</font>

Latest revision as of 19:53, 1 March 2017

External

Internal

Overview

This is a list of available project properties.

Standard System Properties

Top-Level Properties

version

See "project.version" below.

Project Properties

When referencing a ${property.<name>} system property, that translates into an internal Model.get<Name>(), aimed at the project Model instance.

project.groupId

project.artifactId

project.version

See "version" above.

project.basedir

project.baseUri

project.name

project.description

Project Build Properties

project.build.finalName

project.build.directory

project.build.outputDirectory

project.build.sourceDirectory

project.build.testOutputDirectory

Project Parent Properties

project.parent.artifactId

project.parent.groupId

project.parent.version

project.parent.relativePath

Parent Properties

parent.relativePath

Maven Runtime Properties

These properties are exposed via their refid, so they can be accessed externally, from Ant, for example, as follows:

    ....
    <configuration>
        <tasks>
           <property name="maven.test.classpath" refid="maven.test.classpath"/>
    ...

maven.compile.classpath

maven.runtime.classpath

maven.test.classpath

maven.plugin.classpath

Organizatorium

Exposed Directly

These are directly accessible from Ant:

basedir

project.basedir

project.build.directory

project.version

!!!Inaccessible from Ant

Template:Project.version


For an example of how to forward this to Ant, see [Antrun plugin|MavenAntrunPlugin].

!!!Displaying Various Classpath Values at Runtime

Ant can be also used to display various classpath values at runtime, see how to do that also here: [Antrun plugin|MavenAntrunPlugin#DisplayingVariousClasspathValuesAtRuntime].