Note that there are some explanatory texts on larger screens.

plurals
  1. POMaven2 property that indicates the parent directory
    text
    copied!<p>I have a multi-modules project, like this one:</p> <pre><code>main-project/ module1/ module2/ sub-module1/ sub-module2/ sub-module3/ ... module3/ module4/ ... </code></pre> <p>I need to define a set of properties (that are dependent of the environment on which I want to release my project) in Maven2. I will not use <code>&lt;properties&gt;</code> as there is lots of properties... Thus, I use the <a href="http://mojo.codehaus.org/properties-maven-plugin" rel="noreferrer">Properties Maven2 plugin</a>.</p> <p>The properties files are located in the <code>main-project/</code> directory. How can I set the correct directory in the main pom.xml, in order to specify to any children where to find the properties file?</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt; &lt;artifactId&gt;properties-maven-plugin&lt;/artifactId&gt; &lt;version&gt;1.0-alpha-1&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;phase&gt;initialize&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;read-project-properties&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;files&gt; &lt;file&gt;???/env_${env}.properties&lt;/file&gt; &lt;/files&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; </code></pre> <p>If I set only <code>&lt;file&gt;env_${env}.properties&lt;/file&gt;</code>, then when Maven2 compiles the first module, it will not find the <code>main-project/env_dev.properties</code> file. If I set <code>&lt;file&gt;../env_${env}.properties&lt;/file&gt;</code>, then an error will be raised at the parent level, or at any sub-module level...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload