Maven and Environment Variables: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Maven =Overview= Maven is able to access environment variables in its configuration files by specifying the environment variable using the f...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Internal=
=Internal=


* [[Maven#Subjects|Maven]]
* [[Maven_Concepts#Environment_Variables|Maven Concepts - Variables]]


=Overview=
=Overview=
Line 14: Line 14:


<pre>
<pre>
...
<repository>
<repository>
   <id>jboss-eap-repository-6.4.0</id>
   <id>jboss-eap-repository-6.4.0</id>
   <url>file://${env.RUNTIME_DIR}/jboss-eap-6.4.0.GA-maven-repository</url>
   <url>file://${env.RUNTIME_DIR}/jboss-eap-6.4.0.GA-maven-repository</url>
</repository>
</repository>
...
</pre>
</pre>
Environment variables specified as such will be de-referenced in [[Maven pom.xml|pom.xml]] and [[Maven settings.xml#Overview|settings.xml]].

Latest revision as of 19:26, 1 March 2017

Internal

Overview

Maven is able to access environment variables in its configuration files by specifying the environment variable using the following format:

${env.SOME_VARIABLE}

Example of specifying a local filesystem repository:

<repository>
  <id>jboss-eap-repository-6.4.0</id>
  <url>file://${env.RUNTIME_DIR}/jboss-eap-6.4.0.GA-maven-repository</url>
</repository>

Environment variables specified as such will be de-referenced in pom.xml and settings.xml.