You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Rex Huang <re...@gmail.com> on 2008/01/17 12:03:38 UTC

how filter not use some properities in pom.xml

by default in pom.xml there has properity <name>
such as:
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.mycompany.app</groupId>
    <artifactId>my-app</artifactId>
    <packaging>jar</packaging>
    <version>1.1-SNAPSHOT</version>
    <name>my-app</name>

and I use filtering like this:
      <build>
        <resources>
          <resource>
            <directory>src/main/resources</directory -->
            <filtering>true</filtering>
          </resource>
        </resources>
    </build>

then files in src/main/resources has been replaced not as I wanted, such as
in abc.txt:
path=${name}.dat changed to path=my-app.dat

actually I don't want it to be replaced, how can I do?

Re: how filter not use some properities in pom.xml

Posted by Stephen Connolly <st...@gmail.com>.
The only bit I have not decided is how to handle webapps.... currently I end
up with
src/
  main/
    webapp/
  filtered/
    webapp/

but of course that breaks the rule.

I'd use the filtered for resources... but then where do the filtered test
resources go?!?

On Jan 17, 2008 9:25 PM, Stephen Connolly <st...@gmail.com>
wrote:

> I normally change how the resources folders are set up.
>
> I have
>
> src/
>   main/
>     java/
>     resources/
>       filtered/
>       verbatim/
>   test/
>     java/
>     resources/
>       filtered/
>       verbatim/
>
> That way I have the resources with filtering in the filtered directory and
> without in the verbatim directories.  Makes life a lot easier.  No messing
> about with include/exclude rules, etc. And developers know if it's in
> verbatim, it will be copied verbatim!
>
>
> 2008/1/17 Rex Huang <re...@gmail.com>:
>
> > Thanks Jeff, you method is sensible,
> > but I am doing a migration project, I don't wanna to modify the file,
> > because program may use it.
> > So maven do not separate properties and filters, it may cause problem.
> > I don't know whether other properties may affecting my files also.
> >
> > BR//Rex
> >
> >
> > 2008/1/17 Jeff MAURY <jeffmaury@jeffmaury.com >:
> >
> > > Either you change the name of the property in your file or use the
> > > properties tag in your pom but I'm afraid it will affect Maven.
> > >
> > > Jeff
> > >
> > >
> > > 2008/1/17 Rex Huang < rex.huang936@gmail.com>:
> > >
> > > > but I need to use filtering in other files with other properties,
> > > > so filtering must be set to true, but <name> is set by default, I
> > don't
> > > > want
> > > > to use it as filter.
> > > >
> > > > BR//Rex
> > > >
> > > > 2008/1/17 Jeff MAURY <je...@jeffmaury.com>:
> > > >
> > > > > Change filtering from true to false.
> > > > >
> > > > > On Jan 17, 2008 12:03 PM, Rex Huang <re...@gmail.com>
> > wrote:
> > > > >
> > > > > > by default in pom.xml there has properity <name>
> > > > > > such as:
> > > > > >    <modelVersion>4.0.0</modelVersion>
> > > > > >    <groupId> com.mycompany.app</groupId>
> > > > > >    <artifactId>my-app</artifactId>
> > > > > >    <packaging>jar</packaging>
> > > > > >    <version>1.1-SNAPSHOT </version>
> > > > > >    <name>my-app</name>
> > > > > >
> > > > > > and I use filtering like this:
> > > > > >      <build>
> > > > > >        <resources>
> > > > > >          <resource>
> > > > > >            <directory>src/main/resources</directory -->
> > > > > >            <filtering>true</filtering>
> > > > > >          </resource>
> > > > > >        </resources>
> > > > > >    </build>
> > > > > >
> > > > > > then files in src/main/resources has been replaced not as I
> > wanted,
> > > > such
> > > > > > as
> > > > > > in abc.txt:
> > > > > > path=${name}.dat changed to path=my-app.dat
> > > > > >
> > > > > > actually I don't want it to be replaced, how can I do?
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > La mélancolie c'est communiste
> > > > > Tout le monde y a droit de temps en temps
> > > > > La mélancolie n'est pas capitaliste
> > > > > C'est même gratuit pour les perdants
> > > > > La mélancolie c'est pacifiste
> > > > > On ne lui rentre jamais dedans
> > > > > La mélancolie oh tu sais ça existe
> > > > > Elle se prend même avec des gants
> > > > > La mélancolie c'est pour les syndicalistes
> > > > > Il faut juste sa carte de permanent
> > > > >
> > > > > Miossec (2006)
> > > > >
> > > > > http://www.jeffmaury.com
> > > > > http://riadiscuss.jeffmaury.com
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > La mélancolie c'est communiste
> > > Tout le monde y a droit de temps en temps
> > > La mélancolie n'est pas capitaliste
> > > C'est même gratuit pour les perdants
> > > La mélancolie c'est pacifiste
> > > On ne lui rentre jamais dedans
> > > La mélancolie oh tu sais ça existe
> > > Elle se prend même avec des gants
> > > La mélancolie c'est pour les syndicalistes
> > > Il faut juste sa carte de permanent
> > >
> > > Miossec (2006)
> > >
> > > http://www.jeffmaury.com
> > > http://riadiscuss.jeffmaury.com
> > >
> >
>
>

Re: how filter not use some properities in pom.xml

Posted by Stephen Connolly <st...@gmail.com>.
I normally change how the resources folders are set up.

I have

src/
  main/
    java/
    resources/
      filtered/
      verbatim/
  test/
    java/
    resources/
      filtered/
      verbatim/

That way I have the resources with filtering in the filtered directory and
without in the verbatim directories.  Makes life a lot easier.  No messing
about with include/exclude rules, etc. And developers know if it's in
verbatim, it will be copied verbatim!

2008/1/17 Rex Huang <re...@gmail.com>:

> Thanks Jeff, you method is sensible,
> but I am doing a migration project, I don't wanna to modify the file,
> because program may use it.
> So maven do not separate properties and filters, it may cause problem.
> I don't know whether other properties may affecting my files also.
>
> BR//Rex
>
>
> 2008/1/17 Jeff MAURY <je...@jeffmaury.com>:
>
> > Either you change the name of the property in your file or use the
> > properties tag in your pom but I'm afraid it will affect Maven.
> >
> > Jeff
> >
> >
> > 2008/1/17 Rex Huang <re...@gmail.com>:
> >
> > > but I need to use filtering in other files with other properties,
> > > so filtering must be set to true, but <name> is set by default, I
> don't
> > > want
> > > to use it as filter.
> > >
> > > BR//Rex
> > >
> > > 2008/1/17 Jeff MAURY <je...@jeffmaury.com>:
> > >
> > > > Change filtering from true to false.
> > > >
> > > > On Jan 17, 2008 12:03 PM, Rex Huang <re...@gmail.com> wrote:
> > > >
> > > > > by default in pom.xml there has properity <name>
> > > > > such as:
> > > > >    <modelVersion>4.0.0</modelVersion>
> > > > >    <groupId>com.mycompany.app</groupId>
> > > > >    <artifactId>my-app</artifactId>
> > > > >    <packaging>jar</packaging>
> > > > >    <version>1.1-SNAPSHOT</version>
> > > > >    <name>my-app</name>
> > > > >
> > > > > and I use filtering like this:
> > > > >      <build>
> > > > >        <resources>
> > > > >          <resource>
> > > > >            <directory>src/main/resources</directory -->
> > > > >            <filtering>true</filtering>
> > > > >          </resource>
> > > > >        </resources>
> > > > >    </build>
> > > > >
> > > > > then files in src/main/resources has been replaced not as I
> wanted,
> > > such
> > > > > as
> > > > > in abc.txt:
> > > > > path=${name}.dat changed to path=my-app.dat
> > > > >
> > > > > actually I don't want it to be replaced, how can I do?
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > La mélancolie c'est communiste
> > > > Tout le monde y a droit de temps en temps
> > > > La mélancolie n'est pas capitaliste
> > > > C'est même gratuit pour les perdants
> > > > La mélancolie c'est pacifiste
> > > > On ne lui rentre jamais dedans
> > > > La mélancolie oh tu sais ça existe
> > > > Elle se prend même avec des gants
> > > > La mélancolie c'est pour les syndicalistes
> > > > Il faut juste sa carte de permanent
> > > >
> > > > Miossec (2006)
> > > >
> > > > http://www.jeffmaury.com
> > > > http://riadiscuss.jeffmaury.com
> > > >
> > >
> >
> >
> >
> > --
> > La mélancolie c'est communiste
> > Tout le monde y a droit de temps en temps
> > La mélancolie n'est pas capitaliste
> > C'est même gratuit pour les perdants
> > La mélancolie c'est pacifiste
> > On ne lui rentre jamais dedans
> > La mélancolie oh tu sais ça existe
> > Elle se prend même avec des gants
> > La mélancolie c'est pour les syndicalistes
> > Il faut juste sa carte de permanent
> >
> > Miossec (2006)
> >
> > http://www.jeffmaury.com
> > http://riadiscuss.jeffmaury.com
> >
>

Re: how filter not use some properities in pom.xml

Posted by Rex Huang <re...@gmail.com>.
Thanks Jeff, you method is sensible,
but I am doing a migration project, I don't wanna to modify the file,
because program may use it.
So maven do not separate properties and filters, it may cause problem.
I don't know whether other properties may affecting my files also.

BR//Rex


2008/1/17 Jeff MAURY <je...@jeffmaury.com>:

> Either you change the name of the property in your file or use the
> properties tag in your pom but I'm afraid it will affect Maven.
>
> Jeff
>
>
> 2008/1/17 Rex Huang <re...@gmail.com>:
>
> > but I need to use filtering in other files with other properties,
> > so filtering must be set to true, but <name> is set by default, I don't
> > want
> > to use it as filter.
> >
> > BR//Rex
> >
> > 2008/1/17 Jeff MAURY <je...@jeffmaury.com>:
> >
> > > Change filtering from true to false.
> > >
> > > On Jan 17, 2008 12:03 PM, Rex Huang <re...@gmail.com> wrote:
> > >
> > > > by default in pom.xml there has properity <name>
> > > > such as:
> > > >    <modelVersion>4.0.0</modelVersion>
> > > >    <groupId>com.mycompany.app</groupId>
> > > >    <artifactId>my-app</artifactId>
> > > >    <packaging>jar</packaging>
> > > >    <version>1.1-SNAPSHOT</version>
> > > >    <name>my-app</name>
> > > >
> > > > and I use filtering like this:
> > > >      <build>
> > > >        <resources>
> > > >          <resource>
> > > >            <directory>src/main/resources</directory -->
> > > >            <filtering>true</filtering>
> > > >          </resource>
> > > >        </resources>
> > > >    </build>
> > > >
> > > > then files in src/main/resources has been replaced not as I wanted,
> > such
> > > > as
> > > > in abc.txt:
> > > > path=${name}.dat changed to path=my-app.dat
> > > >
> > > > actually I don't want it to be replaced, how can I do?
> > > >
> > >
> > >
> > >
> > > --
> > > La mélancolie c'est communiste
> > > Tout le monde y a droit de temps en temps
> > > La mélancolie n'est pas capitaliste
> > > C'est même gratuit pour les perdants
> > > La mélancolie c'est pacifiste
> > > On ne lui rentre jamais dedans
> > > La mélancolie oh tu sais ça existe
> > > Elle se prend même avec des gants
> > > La mélancolie c'est pour les syndicalistes
> > > Il faut juste sa carte de permanent
> > >
> > > Miossec (2006)
> > >
> > > http://www.jeffmaury.com
> > > http://riadiscuss.jeffmaury.com
> > >
> >
>
>
>
> --
> La mélancolie c'est communiste
> Tout le monde y a droit de temps en temps
> La mélancolie n'est pas capitaliste
> C'est même gratuit pour les perdants
> La mélancolie c'est pacifiste
> On ne lui rentre jamais dedans
> La mélancolie oh tu sais ça existe
> Elle se prend même avec des gants
> La mélancolie c'est pour les syndicalistes
> Il faut juste sa carte de permanent
>
> Miossec (2006)
>
> http://www.jeffmaury.com
> http://riadiscuss.jeffmaury.com
>

Re: how filter not use some properities in pom.xml

Posted by Jeff MAURY <je...@jeffmaury.com>.
Either you change the name of the property in your file or use the
properties tag in your pom but I'm afraid it will affect Maven.

Jeff


2008/1/17 Rex Huang <re...@gmail.com>:

> but I need to use filtering in other files with other properties,
> so filtering must be set to true, but <name> is set by default, I don't
> want
> to use it as filter.
>
> BR//Rex
>
> 2008/1/17 Jeff MAURY <je...@jeffmaury.com>:
>
> > Change filtering from true to false.
> >
> > On Jan 17, 2008 12:03 PM, Rex Huang <re...@gmail.com> wrote:
> >
> > > by default in pom.xml there has properity <name>
> > > such as:
> > >    <modelVersion>4.0.0</modelVersion>
> > >    <groupId>com.mycompany.app</groupId>
> > >    <artifactId>my-app</artifactId>
> > >    <packaging>jar</packaging>
> > >    <version>1.1-SNAPSHOT</version>
> > >    <name>my-app</name>
> > >
> > > and I use filtering like this:
> > >      <build>
> > >        <resources>
> > >          <resource>
> > >            <directory>src/main/resources</directory -->
> > >            <filtering>true</filtering>
> > >          </resource>
> > >        </resources>
> > >    </build>
> > >
> > > then files in src/main/resources has been replaced not as I wanted,
> such
> > > as
> > > in abc.txt:
> > > path=${name}.dat changed to path=my-app.dat
> > >
> > > actually I don't want it to be replaced, how can I do?
> > >
> >
> >
> >
> > --
> > La mélancolie c'est communiste
> > Tout le monde y a droit de temps en temps
> > La mélancolie n'est pas capitaliste
> > C'est même gratuit pour les perdants
> > La mélancolie c'est pacifiste
> > On ne lui rentre jamais dedans
> > La mélancolie oh tu sais ça existe
> > Elle se prend même avec des gants
> > La mélancolie c'est pour les syndicalistes
> > Il faut juste sa carte de permanent
> >
> > Miossec (2006)
> >
> > http://www.jeffmaury.com
> > http://riadiscuss.jeffmaury.com
> >
>



-- 
La mélancolie c'est communiste
Tout le monde y a droit de temps en temps
La mélancolie n'est pas capitaliste
C'est même gratuit pour les perdants
La mélancolie c'est pacifiste
On ne lui rentre jamais dedans
La mélancolie oh tu sais ça existe
Elle se prend même avec des gants
La mélancolie c'est pour les syndicalistes
Il faut juste sa carte de permanent

Miossec (2006)

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com

Re: how filter not use some properities in pom.xml

Posted by Rex Huang <re...@gmail.com>.
but I need to use filtering in other files with other properties,
so filtering must be set to true, but <name> is set by default, I don't want
to use it as filter.

BR//Rex

2008/1/17 Jeff MAURY <je...@jeffmaury.com>:

> Change filtering from true to false.
>
> On Jan 17, 2008 12:03 PM, Rex Huang <re...@gmail.com> wrote:
>
> > by default in pom.xml there has properity <name>
> > such as:
> >    <modelVersion>4.0.0</modelVersion>
> >    <groupId>com.mycompany.app</groupId>
> >    <artifactId>my-app</artifactId>
> >    <packaging>jar</packaging>
> >    <version>1.1-SNAPSHOT</version>
> >    <name>my-app</name>
> >
> > and I use filtering like this:
> >      <build>
> >        <resources>
> >          <resource>
> >            <directory>src/main/resources</directory -->
> >            <filtering>true</filtering>
> >          </resource>
> >        </resources>
> >    </build>
> >
> > then files in src/main/resources has been replaced not as I wanted, such
> > as
> > in abc.txt:
> > path=${name}.dat changed to path=my-app.dat
> >
> > actually I don't want it to be replaced, how can I do?
> >
>
>
>
> --
> La mélancolie c'est communiste
> Tout le monde y a droit de temps en temps
> La mélancolie n'est pas capitaliste
> C'est même gratuit pour les perdants
> La mélancolie c'est pacifiste
> On ne lui rentre jamais dedans
> La mélancolie oh tu sais ça existe
> Elle se prend même avec des gants
> La mélancolie c'est pour les syndicalistes
> Il faut juste sa carte de permanent
>
> Miossec (2006)
>
> http://www.jeffmaury.com
> http://riadiscuss.jeffmaury.com
>

Re: how filter not use some properities in pom.xml

Posted by Jeff MAURY <je...@jeffmaury.com>.
Change filtering from true to false.

On Jan 17, 2008 12:03 PM, Rex Huang <re...@gmail.com> wrote:

> by default in pom.xml there has properity <name>
> such as:
>    <modelVersion>4.0.0</modelVersion>
>    <groupId>com.mycompany.app</groupId>
>    <artifactId>my-app</artifactId>
>    <packaging>jar</packaging>
>    <version>1.1-SNAPSHOT</version>
>    <name>my-app</name>
>
> and I use filtering like this:
>      <build>
>        <resources>
>          <resource>
>            <directory>src/main/resources</directory -->
>            <filtering>true</filtering>
>          </resource>
>        </resources>
>    </build>
>
> then files in src/main/resources has been replaced not as I wanted, such
> as
> in abc.txt:
> path=${name}.dat changed to path=my-app.dat
>
> actually I don't want it to be replaced, how can I do?
>



-- 
La mélancolie c'est communiste
Tout le monde y a droit de temps en temps
La mélancolie n'est pas capitaliste
C'est même gratuit pour les perdants
La mélancolie c'est pacifiste
On ne lui rentre jamais dedans
La mélancolie oh tu sais ça existe
Elle se prend même avec des gants
La mélancolie c'est pour les syndicalistes
Il faut juste sa carte de permanent

Miossec (2006)

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com