ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dimitris Mouchritsas <dimitris.mouchrit...@eurodyn.com>
Subject Re: filterina a file using in jar -> metainf task
Date Wed, 03 Feb 2010 17:30:21 GMT
Hi Antoine,
thanks for the reply. Yes in the end that's what I did. I create a 
${build.dir}/filtered directory where I copy the files I want to filter.
I just had hoped if the jar was supporting this, so I could avoid the copy.

Regards
Dimitris

Antoine Levy Lambert wrote:
> Hello Dimitris,
> 
> you can change persistence.xml before letting the <jar/> task consume it 
> with the copy task as you mention.
> 
> Another approach is to build a standard jar without the concrete 
> properties of a deployment environment and to tweak the jar at 
> deployment time. Ant can update zip/jar/war/ear files easily.
> 
> On my project we are storing the environment dependent properties in a 
> LDAP tree (with one branch per environment inside the tree) and the 
> deployment script fills in the blanks in the property files and updates 
> the ear file, which is built initially without the environment dependent 
> property files. This makes the deployment process more agile and 
> responsive to changes in host names/port numbers/...
> 
> Regards,
> 
> Antoine
> 
> 
> 
> Dimitris Mouchritsas wrote:
>> Hi all,
>> is it possible to use a filter in the metainf task of jar task?
>> Currently my build file is like this:
>>     <target name="domain-dist" description="Build the distribution jar"
>>             depends="domain-test">
>>         <jar destfile="${dist.prepare.dir}/${domain.artifact.name}"
>>              basedir="${classes.dir}">
>>              <patternset refid="domain.classes.pattern" />
>>              <metainf dir="${etc.dir}/domain/META-INF" />
>>          </jar>
>>     </target>
>>
>> In etc/domain/META-INF I have the persistence.xml file for my entity 
>> beans and I would like to be able to pass the datasource name through a
>> filter (or a property?)
>> e.g. original file:
>> <jta-data-source>java:jdbc/@ds.name@</jta-data-source>
>> desired file:
>> <jta-data-source>java:jdbc/projectDS</jta-data-source>
>>
>> Is this possible or I have to use <copy> task?
>>
>> Thanks
>>
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message