You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Bob Arnott <bo...@aungate.com> on 2006/03/01 18:48:59 UTC
Filtering bits of a pom.xml file
Hello, I've got a bit of a situation where development will be happening across
two sites that wont be able to share local repositories. From looking at the
documentation I see I can filter values in resource files -
# application.properties
application.name=${pom.name}
application.version=${pom.version}
message=${my.filter.value}
However, I want to do something similar but with the pom.xml, so I can filter
for the local repository, i.e.
<repositories>
<repository>
<id>local-repo</id>
<url>${local.repo.url}</url>
</repository>
</repositories>
Is this possible...? If so, where do I specify local.repo.url...?
Cheers,
--
Bob Arnott
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Filtering bits of a pom.xml file
Posted by Miguel Griffa <mi...@gmail.com>.
instead of specifyind -D on the command line you can define it in your
settings.xml
a usefull aproach for sharing project information, including properties, is
using inheritance
make your project inherit from a common pom and define there the properties
you want to share
but if you think ant way you'll have trouble, maven is a different building
concept, that's my 0.02c
On 3/2/06, Bob Arnott <bo...@aungate.com> wrote:
>
> Henry S. Isidro wrote:
>
> [snipped...]
>
> > Have you tried passing it via command line? For example, mvn package
> > -Dlocal.repo.url=your_local_repo
>
> Why would I want to do this...? That would mean every time I run maven,
> I've
> got to specify loads of options, which defeats the point really. What I
> want
> is something like a properties file that each developer can change to suit
> themselves and that will replace values in the pom.xml when it comes to
> doing
> anything.
>
> I'm new to mven and want to use it on a couple of new prokject instead of
> ant,
> but unless I can do something similar to loading a properties file with
> ant,
> I'll have to go back to using ant. Using ant, I'd do -
>
> <property file="build.properties" />.
>
> What do I do with maven...?
>
> Cheers,
>
> --
> Bob Arnott
>
> Senior Software Developer
> Autonomy Systems Ltd.
> Cambridge Business Park
> Cowley Road
> Cambridge
> CB4 0WZ
>
> T: +44 (0) 1223 448 000
> F: +44 (0) 1223 448 001
> http://www.aungate.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
--
Miguel Griffa
Skype: miguel.griffa
Y!: m_griffa
MSN: m1gu3l1t0_6@hotmail.com
Cell: 15-62519355
Re: Filtering bits of a pom.xml file
Posted by Bob Arnott <bo...@aungate.com>.
Henry S. Isidro wrote:
[snipped...]
> Have you tried passing it via command line? For example, mvn package
> -Dlocal.repo.url=your_local_repo
Why would I want to do this...? That would mean every time I run maven, I've
got to specify loads of options, which defeats the point really. What I want
is something like a properties file that each developer can change to suit
themselves and that will replace values in the pom.xml when it comes to doing
anything.
I'm new to mven and want to use it on a couple of new prokject instead of ant,
but unless I can do something similar to loading a properties file with ant,
I'll have to go back to using ant. Using ant, I'd do -
<property file="build.properties" />.
What do I do with maven...?
Cheers,
--
Bob Arnott
Senior Software Developer
Autonomy Systems Ltd.
Cambridge Business Park
Cowley Road
Cambridge
CB4 0WZ
T: +44 (0) 1223 448 000
F: +44 (0) 1223 448 001
http://www.aungate.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Filtering bits of a pom.xml file
Posted by "Henry S. Isidro" <hi...@exist.com>.
Bob Arnott wrote:
> Hello, I've got a bit of a situation where development will be
> happening across
> two sites that wont be able to share local repositories. From looking
> at the
> documentation I see I can filter values in resource files -
>
> # application.properties
> application.name=${pom.name}
> application.version=${pom.version}
> message=${my.filter.value}
>
> However, I want to do something similar but with the pom.xml, so I can
> filter
> for the local repository, i.e.
>
> <repositories>
> <repository>
> <id>local-repo</id>
> <url>${local.repo.url}</url>
> </repository>
> </repositories>
>
> Is this possible...? If so, where do I specify local.repo.url...?
>
> Cheers,
>
Have you tried passing it via command line? For example, mvn package
-Dlocal.repo.url=your_local_repo
I haven't actually tried this so let me know if it works. :-)
- Henry
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org