You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Jeudy, Guillaume" <gj...@teksystems.com> on 2008/06/04 20:07:46 UTC
Maven2 filtering capabilities
Hi,
I have a datasource XML file that is deployed to jboss deploy directory. Is there a possibility for maven2 to apply filtering capabilities on my datasource XML file without having it copied to the target directory and packaged with within my artifact ? Id like to filter the XML file and copy it with a custom task to my deployment directory.
The copy part I can already do with the following plugin:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<copy file="src/main/config/ReferenceDataManager-ds.xml"
tofile="${env.JBOSS_HOME}/server/${deploy.server}/deploy/ReferenceDataManager-ds.xml" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
I would like to avoid having to create a separate maven2 subproject just to deploy my XML datasource file after being filtered and replaced with various properties. I'm not even sure such a workaround is possible. Can the artifact be of XML type ?
More importantly can I use filtering functionality standalone without being forced to copy the filtered file to the target directory ?
Thanks,
-Guillaume
____________________________________________________________________________________________________
This electronic mail (including any attachments) may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic email or its contents (including any attachments) by persons other than the intended recipient(s) is strictly prohibited. If you have received this message in error, please notify us immediately by reply email so that we may correct our internal records. Please then delete the original message (including any attachments) in its entirety. Thank you.
RE: Maven2 filtering capabilities
Posted by "Jeudy, Guillaume" <gj...@teksystems.com>.
Hi Mick,
The problem is not with my filter file, its with the fact that the resources filtering is coupled with the copy to target dir. I cannot just ask to filter and copy to a custom location; it has to be copied to the target dir.
The workaround I was looking at is have a separate project that filters, copy to target and then deploy as a straight XML file but for this to work I need a feature such as a <packaging>xml</packaging> instead of <packaging>jar</packaging>.
Does a similar feature exist in maven or with the use of a plugin ?
Thanks,
-Guillaume
________________________________
From: Mick Knutson [mailto:mickknutson@gmail.com]
Sent: Wed 04/06/2008 2:10 PM
To: Maven Users List
Subject: Re: Maven2 filtering capabilities
I use this in my pom:
<filters>
<filter>${filter.file}</filter>
</filters>
then this in my settings.xml:
<filter.file>C:/opt/baselogic/src/main/filters/filter-local.properties</filter.file>
Then I assume you can point the filter.file to anywhere on the machine for
building.
On Wed, Jun 4, 2008 at 11:07 AM, Jeudy, Guillaume <gj...@teksystems.com>
wrote:
> Hi,
>
> I have a datasource XML file that is deployed to jboss deploy directory. Is
> there a possibility for maven2 to apply filtering capabilities on my
> datasource XML file without having it copied to the target directory and
> packaged with within my artifact ? Id like to filter the XML file and copy
> it with a custom task to my deployment directory.
>
> The copy part I can already do with the following plugin:
>
> <plugin>
> <artifactId>maven-antrun-plugin</artifactId>
> <executions>
> <execution>
> <phase>install</phase>
> <goals>
> <goal>run</goal>
> </goals>
> <configuration>
> <tasks>
> <copy file="src/main/config/ReferenceDataManager-ds.xml"
> tofile="${env.JBOSS_HOME}/server/${deploy.server}/deploy/ReferenceDataManager-ds.xml"
> />
> </tasks>
> </configuration>
> </execution>
> </executions>
> </plugin>
>
> I would like to avoid having to create a separate maven2 subproject just to
> deploy my XML datasource file after being filtered and replaced with various
> properties. I'm not even sure such a workaround is possible. Can the
> artifact be of XML type ?
>
> More importantly can I use filtering functionality standalone without being
> forced to copy the filtered file to the target directory ?
>
> Thanks,
>
> -Guillaume
>
>
>
>
> ____________________________________________________________________________________________________
> This electronic mail (including any attachments) may contain information
> that is privileged, confidential, and/or otherwise protected from disclosure
> to anyone other than its intended recipient(s). Any dissemination or use of
> this electronic email or its contents (including any attachments) by persons
> other than the intended recipient(s) is strictly prohibited. If you have
> received this message in error, please notify us immediately by reply email
> so that we may correct our internal records. Please then delete the original
> message (including any attachments) in its entirety. Thank you.
>
--
---
Thank You...
Mick Knutson
BASE Logic, inc.
Website: http://baselogic.com <http://baselogic.com/>
Blog: http://baselogic.com/blog
BLiNC Magazine: http://blincmagazine.com <http://blincmagazine.com/>
Linked IN: http://linkedin.com/in/mickknutson
DJ Mick: http://djmick.com <http://djmick.com/>
MySpace: http://myspace.com/mickknutson
Tahoe: http://tahoe.baselogic.com <http://tahoe.baselogic.com/>
____________________________________________________________________________________________________
This electronic mail (including any attachments) may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic email or its contents (including any attachments) by persons other than the intended recipient(s) is strictly prohibited. If you have received this message in error, please notify us immediately by reply email so that we may correct our internal records. Please then delete the original message (including any attachments) in its entirety. Thank you.
Re: Maven2 filtering capabilities
Posted by Mick Knutson <mi...@gmail.com>.
I use this in my pom:
<filters>
<filter>${filter.file}</filter>
</filters>
then this in my settings.xml:
<filter.file>C:/opt/baselogic/src/main/filters/filter-local.properties</filter.file>
Then I assume you can point the filter.file to anywhere on the machine for
building.
On Wed, Jun 4, 2008 at 11:07 AM, Jeudy, Guillaume <gj...@teksystems.com>
wrote:
> Hi,
>
> I have a datasource XML file that is deployed to jboss deploy directory. Is
> there a possibility for maven2 to apply filtering capabilities on my
> datasource XML file without having it copied to the target directory and
> packaged with within my artifact ? Id like to filter the XML file and copy
> it with a custom task to my deployment directory.
>
> The copy part I can already do with the following plugin:
>
> <plugin>
> <artifactId>maven-antrun-plugin</artifactId>
> <executions>
> <execution>
> <phase>install</phase>
> <goals>
> <goal>run</goal>
> </goals>
> <configuration>
> <tasks>
> <copy file="src/main/config/ReferenceDataManager-ds.xml"
> tofile="${env.JBOSS_HOME}/server/${deploy.server}/deploy/ReferenceDataManager-ds.xml"
> />
> </tasks>
> </configuration>
> </execution>
> </executions>
> </plugin>
>
> I would like to avoid having to create a separate maven2 subproject just to
> deploy my XML datasource file after being filtered and replaced with various
> properties. I'm not even sure such a workaround is possible. Can the
> artifact be of XML type ?
>
> More importantly can I use filtering functionality standalone without being
> forced to copy the filtered file to the target directory ?
>
> Thanks,
>
> -Guillaume
>
>
>
>
> ____________________________________________________________________________________________________
> This electronic mail (including any attachments) may contain information
> that is privileged, confidential, and/or otherwise protected from disclosure
> to anyone other than its intended recipient(s). Any dissemination or use of
> this electronic email or its contents (including any attachments) by persons
> other than the intended recipient(s) is strictly prohibited. If you have
> received this message in error, please notify us immediately by reply email
> so that we may correct our internal records. Please then delete the original
> message (including any attachments) in its entirety. Thank you.
>
--
---
Thank You…
Mick Knutson
BASE Logic, inc.
Website: http://baselogic.com
Blog: http://baselogic.com/blog
BLiNC Magazine: http://blincmagazine.com
Linked IN: http://linkedin.com/in/mickknutson
DJ Mick: http://djmick.com
MySpace: http://myspace.com/mickknutson
Tahoe: http://tahoe.baselogic.com