You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by squidy78 <sq...@gmail.com> on 2010/10/24 02:49:19 UTC

Filtering with @@

Hello

I have the following section in my pom.xml:

<build>


<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
<configuration>
<useDefaultDelimiters>false</useDefaultDelimiters>
<delimiters>
<delimiter>@@</delimiter>
</delimiters>
</configuration>
</plugin>
</plugins>

<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>

</build>

<properties>
<db.server>localhost</db.server>
<db.port>1234</db.port>
</properties>

and in the src/main/resources directory is a config.properties with
following entries:

db.server = @@db.server@@
db.port = @@db.port@@


after running 'mvn clean process-resources' the values in
target/classes/config.properties will be not replaced?! (We use 'Apache
Maven 3.0 (r1004208; 2010-10-04 13:50:56+0200)' )

When I'm using the default delimiters like ${*} or @ everything works fine
and the values will be replaced.

We need really to replace values in property files with the @@ token - with
ant we had no problems, does someone knows how can I do it with the
maven-resources-plugin???

I really appreciate your help - ...there is a bit pressure of time in the
project... :( Thanks!

Re: Filtering with @@

Posted by squidy78 <sq...@gmail.com>.
The problem here is that custom delimiters are not possible in 2.3 - in the
Plugin Documentation: 'since 2.4'.

Is there another way in maven to filtering with @@ delimiters, without the
ant-plugin?


On Sun, Oct 24, 2010 at 4:15 PM, Anders Hammar <an...@hammar.net> wrote:

> There are some issues regarding filter in m-resources-p v2.4+. Like this
> one, which I think is related to your problem:
> http://jira.codehaus.org/browse/MRESOURCES-117
>
> The solution could be to downgrade to v2.3.
>
> /Anders
>
> On Sun, Oct 24, 2010 at 02:49, squidy78 <sq...@gmail.com> wrote:
>
> > Hello
> >
> > I have the following section in my pom.xml:
> >
> > <build>
> >
> >
> > <plugins>
> > <plugin>
> > <artifactId>maven-resources-plugin</artifactId>
> > <version>2.4.3</version>
> > <configuration>
> > <useDefaultDelimiters>false</useDefaultDelimiters>
> > <delimiters>
> > <delimiter>@@</delimiter>
> > </delimiters>
> > </configuration>
> > </plugin>
> > </plugins>
> >
> > <resources>
> > <resource>
> > <directory>src/main/resources</directory>
> > <filtering>true</filtering>
> > </resource>
> > </resources>
> >
> > </build>
> >
> > <properties>
> > <db.server>localhost</db.server>
> > <db.port>1234</db.port>
> > </properties>
> >
> > and in the src/main/resources directory is a config.properties with
> > following entries:
> >
> > db.server = @@db.server@@
> > db.port = @@db.port@@
> >
> >
> > after running 'mvn clean process-resources' the values in
> > target/classes/config.properties will be not replaced?! (We use 'Apache
> > Maven 3.0 (r1004208; 2010-10-04 13:50:56+0200)' )
> >
> > When I'm using the default delimiters like ${*} or @ everything works
> fine
> > and the values will be replaced.
> >
> > We need really to replace values in property files with the @@ token -
> with
> > ant we had no problems, does someone knows how can I do it with the
> > maven-resources-plugin???
> >
> > I really appreciate your help - ...there is a bit pressure of time in the
> > project... :( Thanks!
> >
>

Re: Filtering with @@

Posted by Anders Hammar <an...@hammar.net>.
There are some issues regarding filter in m-resources-p v2.4+. Like this
one, which I think is related to your problem:
http://jira.codehaus.org/browse/MRESOURCES-117

The solution could be to downgrade to v2.3.

/Anders

On Sun, Oct 24, 2010 at 02:49, squidy78 <sq...@gmail.com> wrote:

> Hello
>
> I have the following section in my pom.xml:
>
> <build>
>
>
> <plugins>
> <plugin>
> <artifactId>maven-resources-plugin</artifactId>
> <version>2.4.3</version>
> <configuration>
> <useDefaultDelimiters>false</useDefaultDelimiters>
> <delimiters>
> <delimiter>@@</delimiter>
> </delimiters>
> </configuration>
> </plugin>
> </plugins>
>
> <resources>
> <resource>
> <directory>src/main/resources</directory>
> <filtering>true</filtering>
> </resource>
> </resources>
>
> </build>
>
> <properties>
> <db.server>localhost</db.server>
> <db.port>1234</db.port>
> </properties>
>
> and in the src/main/resources directory is a config.properties with
> following entries:
>
> db.server = @@db.server@@
> db.port = @@db.port@@
>
>
> after running 'mvn clean process-resources' the values in
> target/classes/config.properties will be not replaced?! (We use 'Apache
> Maven 3.0 (r1004208; 2010-10-04 13:50:56+0200)' )
>
> When I'm using the default delimiters like ${*} or @ everything works fine
> and the values will be replaced.
>
> We need really to replace values in property files with the @@ token - with
> ant we had no problems, does someone knows how can I do it with the
> maven-resources-plugin???
>
> I really appreciate your help - ...there is a bit pressure of time in the
> project... :( Thanks!
>