Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Lets call your file build.xml. So you execute it by running ant command. In the first case the artifacts names is hardcoded in the property defined on the third line below</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;project name="build-dependencies"&gt; &lt;property name="artifacts" value="first-value" /&gt; ... &lt;path id="common-jars"&gt; &lt;fileset file="artifacts/project-1/jar/some*.jar" /&gt; &lt;fileset file="artifacts/project-2/jar/someother*.jar" /&gt; &lt;/path&gt; ... &lt;/project&gt; </code></pre> <p>Now when you want to change it and use another value for that artifacts property, we run the script thus</p> <pre><code>ant -Dartifacts=new-value </code></pre> <p>This will override the hardcoded artifacts value in build.xml</p> <p>If working in terms of ant targets you can do something similar, in the target on first line define the property, and if you want to overwrite the default value then pass the property as a parameter when that target is called.</p> <p>Your comment reminded me of something else. Have your developers create a artifacts-dir-name.xml file. It will have only one line:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;project name="artifacts-file"&gt; &lt;property name="artifacts" value="new-value" /&gt; &lt;/project&gt; </code></pre> <p>Now in your build.xml file, before the line where artifacts property is defined, import that file thus:</p> <pre><code>&lt;import file="artifacts-dir-name.xml" optional="true" /&gt; </code></pre> <p>Now in Eclipse if this file exists, then the property is read from it and artifacts is set to "new-value", else the property is read from build.xml and is set to "first-value". All the developers need to do is to ensure artifacts-dir-name.xml file exists in that directory. This can run within Eclipse too.</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