Re: Filtering resources

2016-01-14 Thread Thomas Sundberg
Hi!

On 13 January 2016 at 19:01, Robert Scholte  wrote:
> Hi,
>
> What would you expect when start and end delimiters are the same in
> combination with nested expression. Don't think that'll ever work.
> I assume that in your case @PoolSize.@ and @@ are evaluated.
> AFAIK only with different delimiters nested expressions could work.
>

As long as the delimiters are matched, I would expect a recursive
resolution of them.

That is,

@foo@bar@@

would first resolve the smallest part, @bar@ to something. Say 'ResolvedBar'.
Then it should resolve the larger part @fooResolvedBar@ to whatever
'fooResolvedBar' should be resolved to.

That is the behaviour that I would like to see. And the behaviour I
interpret the closed bug is refering to.
https://issues.apache.org/jira/browse/MRESOURCES-70

Just doing a token replacement token by token is easy to implement. A
recursive resolution is more complicated to implement.

Cheers
Thomas


> thanks,
> Robert
>
> Op Wed, 13 Jan 2016 14:58:29 +0100 schreef Thomas Sundberg :
>
>
>> Hi!
>>
>> Filtering resources that uses @ as delimiters works.
>>
>> This example works as expected:
>> @Environment@
>>
>>
>> But my use case involves filtering nested resources. An example looks like
>> this:
>>
>> @PoolSize.@Environment@@
>>
>> There seem to exist a closed bug regarding nested variables.
>> https://issues.apache.org/jira/browse/MRESOURCES-70
>>
>> Does anybody have another suggestion or should I implement my own
>> filtering as a custom resource filter?
>>
>> /Thomas
>>
>>
>> On 13 January 2016 at 12:04, James Hutton 
>> wrote:
>>>
>>> You could also look at DefaultMavenResourcesFiltering
>>>
>>> 
>>> for
>>> an example. I think this is still using plexus so you'll have to have the
>>> component.xml iirc that is needed for components.
>>>
>>> On Tue, Jan 12, 2016 at 5:33 PM, Baptiste Mathus  wrote:
>>>
 In general, though it would surely work too, better avoid using
 maven-antrun-plugin.
 Maven is about standardizing your build process, using antrun is gonna
 add
 issues with IDEs and so on.

 Anyway, what you ask for doesn't seem to me to require custom filtering.
 '@' is a standard delimiter (see


 http://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html#delimiters
 ),
 so it should work out of the box.

 Just enable filtering on the resources folders you want and you should
 be
 done.

 Cheers


 2016-01-12 23:26 GMT+01:00 Matt Benson :

 > If you just want to get it done, use the maven-antrun-plugin with Ant
 > filtersets.
 >
 > Matt
 >
 > On Tue, Jan 12, 2016 at 4:14 PM, Thomas Sundberg  wrote:
 > > Hi!
 > >
 > > I need to be able to filter files where the values to replace are
 defind
 > as
 > >
 > > @aPlaceHolderThatNeedToBeSubstituted@
 > >
 > > Does anyone know of a good, working example where a custom resource
 > > filter is implemented?
 > >
 > > I had a look at
 > >
 >

 http://maven.apache.org/plugins/maven-resources-plugin/examples/custom-resource-filters.html
 > > and it is a bit sketchy. A complete, annotated example would be nice
 > > where all details needed to implement this interface
 > > MavenResourcesFiltering are shared.
 > >
 > > A Git repo to clone would be the most awesome tip I can think of.
 > >
 > > Cheers,
 > > Thomas
 > >
 > > --
 > > Thomas Sundberg
 > > M. Sc. in Computer Science
 > >
 > > Mobile: +46 70 767 33 15
 > > Blog: http://thomassundberg.wordpress.com/
 > > Twitter: @thomassundberg
 > >
 > > Better software through faster feedback
 > >
 > >
 > > -
 > > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 > > For additional commands, e-mail: users-h...@maven.apache.org
 > >
 >
 > -
 > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 > For additional commands, e-mail: users-h...@maven.apache.org
 >
 >

>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>



-- 
Thomas Sundberg
M. Sc. in Computer Science

Mobile: +46 70 767 33 15
Blog: http://thomassundberg.wordpress.com/
Twitter: @thomassundberg

Better software through faster feedback

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional 

Re: Filtering resources

2016-01-14 Thread Stephen Connolly
and how do I differentiate @foo@bar@@ whether that would be equivalent to
either:

 ${foo}bar${}

or

 ${foo${bar}}

if using ${ } style delimiters for the start and end?

At least with ${ } style delimiters one can count braces...

how about @foo@bar@manchu@ is that supposed to be ${foo${bar}manchu} or
${foo}bar${manchu}

Start trying to answer that question and you will see that the rules get
very fast very quickly

On 14 January 2016 at 09:10, Thomas Sundberg  wrote:

> Hi!
>
> On 13 January 2016 at 19:01, Robert Scholte  wrote:
> > Hi,
> >
> > What would you expect when start and end delimiters are the same in
> > combination with nested expression. Don't think that'll ever work.
> > I assume that in your case @PoolSize.@ and @@ are evaluated.
> > AFAIK only with different delimiters nested expressions could work.
> >
>
> As long as the delimiters are matched, I would expect a recursive
> resolution of them.
>
> That is,
>
> @foo@bar@@
>
> would first resolve the smallest part, @bar@ to something. Say
> 'ResolvedBar'.
> Then it should resolve the larger part @fooResolvedBar@ to whatever
> 'fooResolvedBar' should be resolved to.
>
> That is the behaviour that I would like to see. And the behaviour I
> interpret the closed bug is refering to.
> https://issues.apache.org/jira/browse/MRESOURCES-70
>
> Just doing a token replacement token by token is easy to implement. A
> recursive resolution is more complicated to implement.
>
> Cheers
> Thomas
>
>
> > thanks,
> > Robert
> >
> > Op Wed, 13 Jan 2016 14:58:29 +0100 schreef Thomas Sundberg :
> >
> >
> >> Hi!
> >>
> >> Filtering resources that uses @ as delimiters works.
> >>
> >> This example works as expected:
> >> @Environment@
> >>
> >>
> >> But my use case involves filtering nested resources. An example looks
> like
> >> this:
> >>
> >> @PoolSize.@Environment@@
> >>
> >> There seem to exist a closed bug regarding nested variables.
> >> https://issues.apache.org/jira/browse/MRESOURCES-70
> >>
> >> Does anybody have another suggestion or should I implement my own
> >> filtering as a custom resource filter?
> >>
> >> /Thomas
> >>
> >>
> >> On 13 January 2016 at 12:04, James Hutton 
> >> wrote:
> >>>
> >>> You could also look at DefaultMavenResourcesFiltering
> >>>
> >>> <
> http://maven.apache.org/shared/maven-filtering/apidocs/org/apache/maven/shared/filtering/DefaultMavenResourcesFiltering.html
> >
> >>> for
> >>> an example. I think this is still using plexus so you'll have to have
> the
> >>> component.xml iirc that is needed for components.
> >>>
> >>> On Tue, Jan 12, 2016 at 5:33 PM, Baptiste Mathus 
> wrote:
> >>>
>  In general, though it would surely work too, better avoid using
>  maven-antrun-plugin.
>  Maven is about standardizing your build process, using antrun is gonna
>  add
>  issues with IDEs and so on.
> 
>  Anyway, what you ask for doesn't seem to me to require custom
> filtering.
>  '@' is a standard delimiter (see
> 
> 
> 
> http://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html#delimiters
>  ),
>  so it should work out of the box.
> 
>  Just enable filtering on the resources folders you want and you should
>  be
>  done.
> 
>  Cheers
> 
> 
>  2016-01-12 23:26 GMT+01:00 Matt Benson :
> 
>  > If you just want to get it done, use the maven-antrun-plugin with
> Ant
>  > filtersets.
>  >
>  > Matt
>  >
>  > On Tue, Jan 12, 2016 at 4:14 PM, Thomas Sundberg 
> wrote:
>  > > Hi!
>  > >
>  > > I need to be able to filter files where the values to replace are
>  defind
>  > as
>  > >
>  > > @aPlaceHolderThatNeedToBeSubstituted@
>  > >
>  > > Does anyone know of a good, working example where a custom
> resource
>  > > filter is implemented?
>  > >
>  > > I had a look at
>  > >
>  >
> 
> 
> http://maven.apache.org/plugins/maven-resources-plugin/examples/custom-resource-filters.html
>  > > and it is a bit sketchy. A complete, annotated example would be
> nice
>  > > where all details needed to implement this interface
>  > > MavenResourcesFiltering are shared.
>  > >
>  > > A Git repo to clone would be the most awesome tip I can think of.
>  > >
>  > > Cheers,
>  > > Thomas
>  > >
>  > > --
>  > > Thomas Sundberg
>  > > M. Sc. in Computer Science
>  > >
>  > > Mobile: +46 70 767 33 15
>  > > Blog: http://thomassundberg.wordpress.com/
>  > > Twitter: @thomassundberg
>  > >
>  > > Better software through faster feedback
>  > >
>  > >
>  > >
> -
>  > > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>  > > For additional commands, e-mail: 

Re: Filtering resources

2016-01-14 Thread Thomas Sundberg
Hi!

On 14 January 2016 at 15:09, Stephen Connolly
 wrote:
> and how do I differentiate @foo@bar@@ whether that would be equivalent to
> either:
>
>  ${foo}bar${}
>
> or
>
>  ${foo${bar}}
>

This is obviously a complicated example if you allow empty tokens when
using the same delimiter as start and end indicator.

I don't think empty tokes are reasonable. I can't come up with sample
code that would do any reasonable filtering with

@@

Specifying this token in a property file would look like this:

 = the actual value

So, to me empty tokens are an error or an indication of something else.

Empty tokens when using different delimiters such as ${} is possible
to detect since there are different start and end indicators. But the
question on what you should replace them with is still valid.

>
> if using ${ } style delimiters for the start and end?
>
> At least with ${ } style delimiters one can count braces...
>
> how about @foo@bar@manchu@ is that supposed to be ${foo${bar}manchu} or
> ${foo}bar${manchu}
>

I would go with the latter. Which is consistent with how filtering in
Maven is implemented today.

This limits the possibilities a bit on where you can place nested
tokens. Using the same delimiter, you would only be able to place them
at the beginning or end. That is relying two or more of them next to
each other.

Given this, then would the example

@foo@bar@@

be equal to

 ${foo${bar}}

And

@@foo@bar@

be equal to

${${foo}bar}

Using the same delimiter to indicate start and end of a token is
complicated and it would have been nice if it wasn't allowed. But it
is. And heavily used in the filtering case I need to resolve.

>
> Start trying to answer that question and you will see that the rules get
> very fast very quickly
>

I don't really see that it would be extremely complicated. Definitely
complicated using the same delimiter, but not impossible. Using
different delimiters for start and stop would make it easier.
Remembering Scheme, a lisp dialect, makes me wish for parentheses as
delimiters.

It actually surprises me that nested tokens isn't properly supported
in the case ${${foo}bar} or  ${foo${bar}}
But it isn't when I am testing with Maven 3.3.9 and maven-filtering 3.0.0.

Cheers,
Thomas





>
> On 14 January 2016 at 09:10, Thomas Sundberg  wrote:
>
>> Hi!
>>
>> On 13 January 2016 at 19:01, Robert Scholte  wrote:
>> > Hi,
>> >
>> > What would you expect when start and end delimiters are the same in
>> > combination with nested expression. Don't think that'll ever work.
>> > I assume that in your case @PoolSize.@ and @@ are evaluated.
>> > AFAIK only with different delimiters nested expressions could work.
>> >
>>
>> As long as the delimiters are matched, I would expect a recursive
>> resolution of them.
>>
>> That is,
>>
>> @foo@bar@@
>>
>> would first resolve the smallest part, @bar@ to something. Say
>> 'ResolvedBar'.
>> Then it should resolve the larger part @fooResolvedBar@ to whatever
>> 'fooResolvedBar' should be resolved to.
>>
>> That is the behaviour that I would like to see. And the behaviour I
>> interpret the closed bug is refering to.
>> https://issues.apache.org/jira/browse/MRESOURCES-70
>>
>> Just doing a token replacement token by token is easy to implement. A
>> recursive resolution is more complicated to implement.
>>
>> Cheers
>> Thomas
>>
>>
>> > thanks,
>> > Robert
>> >
>> > Op Wed, 13 Jan 2016 14:58:29 +0100 schreef Thomas Sundberg :
>> >
>> >
>> >> Hi!
>> >>
>> >> Filtering resources that uses @ as delimiters works.
>> >>
>> >> This example works as expected:
>> >> @Environment@
>> >>
>> >>
>> >> But my use case involves filtering nested resources. An example looks
>> like
>> >> this:
>> >>
>> >> @PoolSize.@Environment@@
>> >>
>> >> There seem to exist a closed bug regarding nested variables.
>> >> https://issues.apache.org/jira/browse/MRESOURCES-70
>> >>
>> >> Does anybody have another suggestion or should I implement my own
>> >> filtering as a custom resource filter?
>> >>
>> >> /Thomas
>> >>
>> >>
>> >> On 13 January 2016 at 12:04, James Hutton 
>> >> wrote:
>> >>>
>> >>> You could also look at DefaultMavenResourcesFiltering
>> >>>
>> >>> <
>> http://maven.apache.org/shared/maven-filtering/apidocs/org/apache/maven/shared/filtering/DefaultMavenResourcesFiltering.html
>> >
>> >>> for
>> >>> an example. I think this is still using plexus so you'll have to have
>> the
>> >>> component.xml iirc that is needed for components.
>> >>>
>> >>> On Tue, Jan 12, 2016 at 5:33 PM, Baptiste Mathus 
>> wrote:
>> >>>
>>  In general, though it would surely work too, better avoid using
>>  maven-antrun-plugin.
>>  Maven is about standardizing your build process, using antrun is gonna
>>  add
>>  issues with IDEs and so on.
>> 
>>  Anyway, what you ask for doesn't seem to me to require custom
>> filtering.
>>  '@' is a standard 

Re: Filtering resources

2016-01-13 Thread James Hutton
You could also look at DefaultMavenResourcesFiltering

for
an example. I think this is still using plexus so you'll have to have the
component.xml iirc that is needed for components.

On Tue, Jan 12, 2016 at 5:33 PM, Baptiste Mathus  wrote:

> In general, though it would surely work too, better avoid using
> maven-antrun-plugin.
> Maven is about standardizing your build process, using antrun is gonna add
> issues with IDEs and so on.
>
> Anyway, what you ask for doesn't seem to me to require custom filtering.
> '@' is a standard delimiter (see
>
> http://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html#delimiters
> ),
> so it should work out of the box.
>
> Just enable filtering on the resources folders you want and you should be
> done.
>
> Cheers
>
>
> 2016-01-12 23:26 GMT+01:00 Matt Benson :
>
> > If you just want to get it done, use the maven-antrun-plugin with Ant
> > filtersets.
> >
> > Matt
> >
> > On Tue, Jan 12, 2016 at 4:14 PM, Thomas Sundberg  wrote:
> > > Hi!
> > >
> > > I need to be able to filter files where the values to replace are
> defind
> > as
> > >
> > > @aPlaceHolderThatNeedToBeSubstituted@
> > >
> > > Does anyone know of a good, working example where a custom resource
> > > filter is implemented?
> > >
> > > I had a look at
> > >
> >
> http://maven.apache.org/plugins/maven-resources-plugin/examples/custom-resource-filters.html
> > > and it is a bit sketchy. A complete, annotated example would be nice
> > > where all details needed to implement this interface
> > > MavenResourcesFiltering are shared.
> > >
> > > A Git repo to clone would be the most awesome tip I can think of.
> > >
> > > Cheers,
> > > Thomas
> > >
> > > --
> > > Thomas Sundberg
> > > M. Sc. in Computer Science
> > >
> > > Mobile: +46 70 767 33 15
> > > Blog: http://thomassundberg.wordpress.com/
> > > Twitter: @thomassundberg
> > >
> > > Better software through faster feedback
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > > For additional commands, e-mail: users-h...@maven.apache.org
> > >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > For additional commands, e-mail: users-h...@maven.apache.org
> >
> >
>


Re: Filtering resources

2016-01-13 Thread Thomas Sundberg
Hi!

Filtering resources that uses @ as delimiters works.

This example works as expected:
@Environment@


But my use case involves filtering nested resources. An example looks like this:

@PoolSize.@Environment@@

There seem to exist a closed bug regarding nested variables.
https://issues.apache.org/jira/browse/MRESOURCES-70

Does anybody have another suggestion or should I implement my own
filtering as a custom resource filter?

/Thomas


On 13 January 2016 at 12:04, James Hutton  wrote:
> You could also look at DefaultMavenResourcesFiltering
> 
> for
> an example. I think this is still using plexus so you'll have to have the
> component.xml iirc that is needed for components.
>
> On Tue, Jan 12, 2016 at 5:33 PM, Baptiste Mathus  wrote:
>
>> In general, though it would surely work too, better avoid using
>> maven-antrun-plugin.
>> Maven is about standardizing your build process, using antrun is gonna add
>> issues with IDEs and so on.
>>
>> Anyway, what you ask for doesn't seem to me to require custom filtering.
>> '@' is a standard delimiter (see
>>
>> http://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html#delimiters
>> ),
>> so it should work out of the box.
>>
>> Just enable filtering on the resources folders you want and you should be
>> done.
>>
>> Cheers
>>
>>
>> 2016-01-12 23:26 GMT+01:00 Matt Benson :
>>
>> > If you just want to get it done, use the maven-antrun-plugin with Ant
>> > filtersets.
>> >
>> > Matt
>> >
>> > On Tue, Jan 12, 2016 at 4:14 PM, Thomas Sundberg  wrote:
>> > > Hi!
>> > >
>> > > I need to be able to filter files where the values to replace are
>> defind
>> > as
>> > >
>> > > @aPlaceHolderThatNeedToBeSubstituted@
>> > >
>> > > Does anyone know of a good, working example where a custom resource
>> > > filter is implemented?
>> > >
>> > > I had a look at
>> > >
>> >
>> http://maven.apache.org/plugins/maven-resources-plugin/examples/custom-resource-filters.html
>> > > and it is a bit sketchy. A complete, annotated example would be nice
>> > > where all details needed to implement this interface
>> > > MavenResourcesFiltering are shared.
>> > >
>> > > A Git repo to clone would be the most awesome tip I can think of.
>> > >
>> > > Cheers,
>> > > Thomas
>> > >
>> > > --
>> > > Thomas Sundberg
>> > > M. Sc. in Computer Science
>> > >
>> > > Mobile: +46 70 767 33 15
>> > > Blog: http://thomassundberg.wordpress.com/
>> > > Twitter: @thomassundberg
>> > >
>> > > Better software through faster feedback
>> > >
>> > > -
>> > > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>> > > For additional commands, e-mail: users-h...@maven.apache.org
>> > >
>> >
>> > -
>> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>> > For additional commands, e-mail: users-h...@maven.apache.org
>> >
>> >
>>



-- 
Thomas Sundberg
M. Sc. in Computer Science

Mobile: +46 70 767 33 15
Blog: http://thomassundberg.wordpress.com/
Twitter: @thomassundberg

Better software through faster feedback

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Filtering resources

2016-01-13 Thread Robert Scholte

Hi,

What would you expect when start and end delimiters are the same in  
combination with nested expression. Don't think that'll ever work.

I assume that in your case @PoolSize.@ and @@ are evaluated.
AFAIK only with different delimiters nested expressions could work.

thanks,
Robert

Op Wed, 13 Jan 2016 14:58:29 +0100 schreef Thomas Sundberg :


Hi!

Filtering resources that uses @ as delimiters works.

This example works as expected:
@Environment@


But my use case involves filtering nested resources. An example looks  
like this:


@PoolSize.@Environment@@

There seem to exist a closed bug regarding nested variables.
https://issues.apache.org/jira/browse/MRESOURCES-70

Does anybody have another suggestion or should I implement my own
filtering as a custom resource filter?

/Thomas


On 13 January 2016 at 12:04, James Hutton   
wrote:

You could also look at DefaultMavenResourcesFiltering

for
an example. I think this is still using plexus so you'll have to have  
the

component.xml iirc that is needed for components.

On Tue, Jan 12, 2016 at 5:33 PM, Baptiste Mathus  wrote:


In general, though it would surely work too, better avoid using
maven-antrun-plugin.
Maven is about standardizing your build process, using antrun is gonna  
add

issues with IDEs and so on.

Anyway, what you ask for doesn't seem to me to require custom  
filtering.

'@' is a standard delimiter (see

http://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html#delimiters
),
so it should work out of the box.

Just enable filtering on the resources folders you want and you should  
be

done.

Cheers


2016-01-12 23:26 GMT+01:00 Matt Benson :

> If you just want to get it done, use the maven-antrun-plugin with Ant
> filtersets.
>
> Matt
>
> On Tue, Jan 12, 2016 at 4:14 PM, Thomas Sundberg  wrote:
> > Hi!
> >
> > I need to be able to filter files where the values to replace are
defind
> as
> >
> > @aPlaceHolderThatNeedToBeSubstituted@
> >
> > Does anyone know of a good, working example where a custom resource
> > filter is implemented?
> >
> > I had a look at
> >
>
http://maven.apache.org/plugins/maven-resources-plugin/examples/custom-resource-filters.html
> > and it is a bit sketchy. A complete, annotated example would be  
nice

> > where all details needed to implement this interface
> > MavenResourcesFiltering are shared.
> >
> > A Git repo to clone would be the most awesome tip I can think of.
> >
> > Cheers,
> > Thomas
> >
> > --
> > Thomas Sundberg
> > M. Sc. in Computer Science
> >
> > Mobile: +46 70 767 33 15
> > Blog: http://thomassundberg.wordpress.com/
> > Twitter: @thomassundberg
> >
> > Better software through faster feedback
> >
> >  
-

> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > For additional commands, e-mail: users-h...@maven.apache.org
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>






-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Filtering resources

2016-01-12 Thread Baptiste Mathus
In general, though it would surely work too, better avoid using
maven-antrun-plugin.
Maven is about standardizing your build process, using antrun is gonna add
issues with IDEs and so on.

Anyway, what you ask for doesn't seem to me to require custom filtering.
'@' is a standard delimiter (see
http://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html#delimiters),
so it should work out of the box.

Just enable filtering on the resources folders you want and you should be
done.

Cheers


2016-01-12 23:26 GMT+01:00 Matt Benson :

> If you just want to get it done, use the maven-antrun-plugin with Ant
> filtersets.
>
> Matt
>
> On Tue, Jan 12, 2016 at 4:14 PM, Thomas Sundberg  wrote:
> > Hi!
> >
> > I need to be able to filter files where the values to replace are defind
> as
> >
> > @aPlaceHolderThatNeedToBeSubstituted@
> >
> > Does anyone know of a good, working example where a custom resource
> > filter is implemented?
> >
> > I had a look at
> >
> http://maven.apache.org/plugins/maven-resources-plugin/examples/custom-resource-filters.html
> > and it is a bit sketchy. A complete, annotated example would be nice
> > where all details needed to implement this interface
> > MavenResourcesFiltering are shared.
> >
> > A Git repo to clone would be the most awesome tip I can think of.
> >
> > Cheers,
> > Thomas
> >
> > --
> > Thomas Sundberg
> > M. Sc. in Computer Science
> >
> > Mobile: +46 70 767 33 15
> > Blog: http://thomassundberg.wordpress.com/
> > Twitter: @thomassundberg
> >
> > Better software through faster feedback
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > For additional commands, e-mail: users-h...@maven.apache.org
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: Filtering resources

2016-01-12 Thread Matt Benson
If you just want to get it done, use the maven-antrun-plugin with Ant
filtersets.

Matt

On Tue, Jan 12, 2016 at 4:14 PM, Thomas Sundberg  wrote:
> Hi!
>
> I need to be able to filter files where the values to replace are defind as
>
> @aPlaceHolderThatNeedToBeSubstituted@
>
> Does anyone know of a good, working example where a custom resource
> filter is implemented?
>
> I had a look at
> http://maven.apache.org/plugins/maven-resources-plugin/examples/custom-resource-filters.html
> and it is a bit sketchy. A complete, annotated example would be nice
> where all details needed to implement this interface
> MavenResourcesFiltering are shared.
>
> A Git repo to clone would be the most awesome tip I can think of.
>
> Cheers,
> Thomas
>
> --
> Thomas Sundberg
> M. Sc. in Computer Science
>
> Mobile: +46 70 767 33 15
> Blog: http://thomassundberg.wordpress.com/
> Twitter: @thomassundberg
>
> Better software through faster feedback
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Filtering resources with variables from build-helper-maven-plugin:reserve-network-port

2014-09-16 Thread Baptiste Mathus
Hi Martin,

This should be totally feasible. Indeed, even the ITs of the plugin itself
actually use the fact that properties are indeed defined to be able to
print them out at some later point.
Would you be able to expose some demo project somewhere on GitHub for
example?

Cheers

2014-09-16 13:45 GMT+02:00 Martin Todorov carlspr...@gmail.com:

 Hi,

 I've been dealing with a bit of an odd scenario where i have number of
 projects running in Jenkins which all open ports for different things
 (Jetty, Derby, various other servers). So, in order for them to not clash,
 I am using the build-helper-maven-plugin's reserve-network-port goal
 attached to the initialize phases. This all works fine. However, I would
 like to use the variables for the assigned ports to filter some values in a
 few resource files. This seems to not be working.

 Is it at all possible to do something like this, or is this particular
 plugin running too late (or exporting the variables within a different
 context to what is visible to the maven-resources-plugin)?

 Thanks in advance and looking forward to your comments!

 Martin Todorov




-- 
Baptiste Batmat MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !


RE: filtering resources - switching whole files

2008-04-10 Thread Bernhard David
Hi,

I think this'll do the trick:

make differrent directories like src/main/dev, src/main/prod etc. and
set up the POM:

profiles
  profile
iddev/id
build
  resources
resource
  directorysrc/main/dev/directory
/resource
  /resources
/build
   /profile 

and so on. Then with mvn -P dev you choose a profile, and only the
files from that profile will be copied. Any resources you declare
outside of the profiles (regular build) will be copied for all
profiles.

David

 -Original Message-
 From: Nick Stolwijk [mailto:[EMAIL PROTECTED] 
 Sent: 10 April 2008 00:10
 To: Maven Users List
 Subject: Re: filtering resources - switching whole files
 
 For different config files I often do it with an include. I.e. spring 
 configuration for production, test, dev, make a main 
 applicationContext.xml which includes 
 database-${environment}.xml. Now 
 you can switch config files between builds. (Or at runtime, 
 if you don't 
 filter.
 
 Hth,
 
 Nick S.
 
 Jan Zelenka wrote:
  Hi,
  I have different config files for various build targets 
 (dev, test, prod), 
  but I cannot use standard resource filtering because whole 
 portions of the 
  files are diferrent, not just simple strings. In Ant I have 
 a copy of the 
  file for each target and just copy/rename them during 
 build. What would be 
  the best way to do this in maven? Preferably using profiles 
 to choose 
  targets.
 
  Thank you,
  Jan
   

 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: filtering resources - switching whole files

2008-04-09 Thread Nick Stolwijk
For different config files I often do it with an include. I.e. spring 
configuration for production, test, dev, make a main 
applicationContext.xml which includes database-${environment}.xml. Now 
you can switch config files between builds. (Or at runtime, if you don't 
filter.


Hth,

Nick S.

Jan Zelenka wrote:

Hi,
I have different config files for various build targets (dev, test, prod), 
but I cannot use standard resource filtering because whole portions of the 
files are diferrent, not just simple strings. In Ant I have a copy of the 
file for each target and just copy/rename them during build. What would be 
the best way to do this in maven? Preferably using profiles to choose 
targets.


Thank you,
Jan
 
  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Filtering resources in Assembly plugin

2007-12-27 Thread Ryan Moquin
So I take it that filtering the fileSets probably still hasn't been fixed?

On Sep 21, 2007 12:52 PM, Paul Austin [EMAIL PROTECTED] wrote:

 Will the filtering of dependencySets also be fixed?

 Paul

 Mick Knutson wrote:
  the filtering filesSets will be fixed in the next release, but you
 have to
  use files for now. I opened the defect about a month.
 
 
 
 
  On 9/21/07, Dave Feltenberger [EMAIL PROTECTED] wrote:
 
  I think I found a bug in the assembly plugin.  When I specify a single
  file in my assembly, like so:
  files
  file
  sourcesrc/main/resources/faxing.sh/source
  outputDirectory//outputDirectory
  filteredtrue/filtered
  /file
  /files
 
  it is filtered properly using the projectbuildfilters.
 
  But if I specify a fileset, like so:
  fileSets
  fileSet
  directorysrc/main/resources/directory
  outputDirectory//outputDirectory
  includes
  include*.sh/include
  /includes
  filteredtrue/filtered
  /fileSet
  /fileSets
 
  the resources are *not* filtered.  This isn't intentional, is it?
 
  Dave
 
  On 9/21/07, Dave Feltenberger [EMAIL PROTECTED] wrote:
 
  All,
 
  I'm having an issue filtering resources with the assembly plugin.
 
  In the documentation at:
 
 
 
 http://maven.apache.org/plugins/maven-assembly-plugin/examples/single/filtering-some-distribution-files.html
 
  there is an example of using the assembly plugin.  Here is the part in
  the pom that says how to specify the filter file:
 
plugin
  artifactIdmaven-assembly-plugin/artifactId
  configuration
filters
  filtersrc/assemble/filter.properties/filter
/filters
descriptors
  descriptorsrc/assemble/distribution.xml/descriptor
/descriptors
  /configuration
/plugin
 
  When I add a filters tag in my pom in the location specified above,
  I get the following error:
  [INFO] Error configuring:
  org.apache.maven.plugins:maven-assembly-plugin. Reason: ERROR: Cannot
  override read-only parameter: filters in goal: assembly:assembly
 
  I've tried lots of permutations: adding the filters tag to the
  projectbuild structure, configuring it to run the attached goal,
  etc., and nothing will work.  When I specify the filters in the
  build tag, I get no error, but it also doesn't filter.
 
  Is this an error in the documentation or an issue with 2.2-beta1?  Or
  am I just doing something incorrectly?
 
  Dave
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Filtering resources in Assembly plugin

2007-12-27 Thread Mick Knutson
Not yet. Very tedious, but at least it works Hopefully it will be fixed
soon.


On Dec 27, 2007 8:44 AM, Ryan Moquin [EMAIL PROTECTED] wrote:

 So I take it that filtering the fileSets probably still hasn't been fixed?

 On Sep 21, 2007 12:52 PM, Paul Austin [EMAIL PROTECTED] wrote:

  Will the filtering of dependencySets also be fixed?
 
  Paul
 
  Mick Knutson wrote:
   the filtering filesSets will be fixed in the next release, but you
  have to
   use files for now. I opened the defect about a month.
  
  
  
  
   On 9/21/07, Dave Feltenberger [EMAIL PROTECTED] wrote:
  
   I think I found a bug in the assembly plugin.  When I specify a
 single
   file in my assembly, like so:
   files
   file
   sourcesrc/main/resources/faxing.sh/source
   outputDirectory//outputDirectory
   filteredtrue/filtered
   /file
   /files
  
   it is filtered properly using the projectbuildfilters.
  
   But if I specify a fileset, like so:
   fileSets
   fileSet
   directorysrc/main/resources/directory
   outputDirectory//outputDirectory
   includes
   include*.sh/include
   /includes
   filteredtrue/filtered
   /fileSet
   /fileSets
  
   the resources are *not* filtered.  This isn't intentional, is it?
  
   Dave
  
   On 9/21/07, Dave Feltenberger [EMAIL PROTECTED] wrote:
  
   All,
  
   I'm having an issue filtering resources with the assembly plugin.
  
   In the documentation at:
  
  
  
 
 http://maven.apache.org/plugins/maven-assembly-plugin/examples/single/filtering-some-distribution-files.html
  
   there is an example of using the assembly plugin.  Here is the part
 in
   the pom that says how to specify the filter file:
  
 plugin
   artifactIdmaven-assembly-plugin/artifactId
   configuration
 filters
   filtersrc/assemble/filter.properties/filter
 /filters
 descriptors
   descriptorsrc/assemble/distribution.xml/descriptor
 /descriptors
   /configuration
 /plugin
  
   When I add a filters tag in my pom in the location specified
 above,
   I get the following error:
   [INFO] Error configuring:
   org.apache.maven.plugins:maven-assembly-plugin. Reason: ERROR:
 Cannot
   override read-only parameter: filters in goal: assembly:assembly
  
   I've tried lots of permutations: adding the filters tag to the
   projectbuild structure, configuring it to run the attached goal,
   etc., and nothing will work.  When I specify the filters in the
   build tag, I get no error, but it also doesn't filter.
  
   Is this an error in the documentation or an issue with 2.2-beta1?
  Or
   am I just doing something incorrectly?
  
   Dave
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
  
  
  
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 




-- 
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/BLiNCMagazine
http://tahoe.baselogic.com
---


Re: Filtering resources in Assembly plugin

2007-12-27 Thread Ryan Moquin
Ok, just wanted to make sure I wasn't doing something wrong.

Thanks!

On Dec 27, 2007 11:52 AM, Mick Knutson [EMAIL PROTECTED] wrote:

 Not yet. Very tedious, but at least it works Hopefully it will be
 fixed
 soon.


 On Dec 27, 2007 8:44 AM, Ryan Moquin [EMAIL PROTECTED] wrote:

  So I take it that filtering the fileSets probably still hasn't been
 fixed?
 
  On Sep 21, 2007 12:52 PM, Paul Austin [EMAIL PROTECTED] wrote:
 
   Will the filtering of dependencySets also be fixed?
  
   Paul
  
   Mick Knutson wrote:
the filtering filesSets will be fixed in the next release, but you
   have to
use files for now. I opened the defect about a month.
   
   
   
   
On 9/21/07, Dave Feltenberger [EMAIL PROTECTED] wrote:
   
I think I found a bug in the assembly plugin.  When I specify a
  single
file in my assembly, like so:
files
file
   
 sourcesrc/main/resources/faxing.sh/source
outputDirectory//outputDirectory
filteredtrue/filtered
/file
/files
   
it is filtered properly using the projectbuildfilters.
   
But if I specify a fileset, like so:
fileSets
fileSet
directorysrc/main/resources/directory
outputDirectory//outputDirectory
includes
include*.sh/include
/includes
filteredtrue/filtered
/fileSet
/fileSets
   
the resources are *not* filtered.  This isn't intentional, is it?
   
Dave
   
On 9/21/07, Dave Feltenberger [EMAIL PROTECTED] wrote:
   
All,
   
I'm having an issue filtering resources with the assembly plugin.
   
In the documentation at:
   
   
   
  
 
 http://maven.apache.org/plugins/maven-assembly-plugin/examples/single/filtering-some-distribution-files.html
   
there is an example of using the assembly plugin.  Here is the
 part
  in
the pom that says how to specify the filter file:
   
  plugin
artifactIdmaven-assembly-plugin/artifactId
configuration
  filters
filtersrc/assemble/filter.properties/filter
  /filters
  descriptors
descriptorsrc/assemble/distribution.xml/descriptor
  /descriptors
/configuration
  /plugin
   
When I add a filters tag in my pom in the location specified
  above,
I get the following error:
[INFO] Error configuring:
org.apache.maven.plugins:maven-assembly-plugin. Reason: ERROR:
  Cannot
override read-only parameter: filters in goal: assembly:assembly
   
I've tried lots of permutations: adding the filters tag to the
projectbuild structure, configuring it to run the attached
 goal,
etc., and nothing will work.  When I specify the filters in the
build tag, I get no error, but it also doesn't filter.
   
Is this an error in the documentation or an issue with 2.2-beta1?
   Or
am I just doing something incorrectly?
   
Dave
   
   
   
 -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
   
   
   
   
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 



 --
 Thanks,
 Mick Knutson

 http://www.baselogic.com
 http://www.blincmagazine.com
 http://www.djmick.com
 http://www.myspace.com/mickknutson
 http://www.myspace.com/BLiNCMagazine
 http://tahoe.baselogic.com
 ---



Re: Filtering Resources : Maven Properties for username builddat

2007-11-13 Thread Wayne Fay
This comes up pretty often. Search this lists' archives (in Nabble)
for timestamp.

Wayne

On 11/13/07, zm [EMAIL PROTECTED] wrote:

 Hi,

 I'm finishing a pom.xml file, and I need some resource filtering.

 Let's say I have a resource file named: build.properties:

 build.date=${build.date}
 build.version=${project.parent.version}
 build.author=${build.username}

 In my pom.xml, I have the following block:

build
resources
resource
directorysrc/main/resources/directory
filteringtrue/filtering
/resource
/resources
...
/build

 Running the application, the given properties will be loaded and displayed.

 Now I need a way of defining them with the filter feature.

 I know that the META-INF folder will have a MANIFEST.MF generated by maven,
 with the entry Built-By: username (where I assume username to be the
 system user).

 Is there a way of using that value in filtering?

 What about accessing the build timestamp? I would like to format the
 ${build.date} with something like '2007.11.13 15:05:30.123'. Any way of
 doing it?

 Also I could use an ANT task to create properties (property .../). Is
 there a way of including an ant task, define a property then use it with
 filtering?


 EDIT:

 Ok, I've changed the properties file to:

 build.date=${build.date}
 build.version=${project.parent.version}
 build.author=${user.name}
 build.javaversion=${java.version}

 Now I have everything but the build date, which I would like to format as a
 timestamp. Any tips on how to include/access such a property in filtering?



 Many thanks.
 --
 View this message in context: 
 http://www.nabble.com/Filtering-Resources-%3A-Maven-Properties-for-username---builddate-tf4798288s177.html#a13727498
 Sent from the Maven - Users mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Filtering resources in Assembly plugin

2007-09-21 Thread Dave Feltenberger
I think I found a bug in the assembly plugin.  When I specify a single
file in my assembly, like so:
files
file
sourcesrc/main/resources/faxing.sh/source
outputDirectory//outputDirectory
filteredtrue/filtered
/file
/files

it is filtered properly using the projectbuildfilters.

But if I specify a fileset, like so:
fileSets
fileSet
directorysrc/main/resources/directory
outputDirectory//outputDirectory
includes
include*.sh/include
/includes
filteredtrue/filtered
/fileSet
/fileSets

the resources are *not* filtered.  This isn't intentional, is it?

Dave

On 9/21/07, Dave Feltenberger [EMAIL PROTECTED] wrote:
 All,

 I'm having an issue filtering resources with the assembly plugin.

 In the documentation at:
 http://maven.apache.org/plugins/maven-assembly-plugin/examples/single/filtering-some-distribution-files.html

 there is an example of using the assembly plugin.  Here is the part in
 the pom that says how to specify the filter file:

   plugin
 artifactIdmaven-assembly-plugin/artifactId
 configuration
   filters
 filtersrc/assemble/filter.properties/filter
   /filters
   descriptors
 descriptorsrc/assemble/distribution.xml/descriptor
   /descriptors
 /configuration
   /plugin

 When I add a filters tag in my pom in the location specified above,
 I get the following error:
 [INFO] Error configuring:
 org.apache.maven.plugins:maven-assembly-plugin. Reason: ERROR: Cannot
 override read-only parameter: filters in goal: assembly:assembly

 I've tried lots of permutations: adding the filters tag to the
 projectbuild structure, configuring it to run the attached goal,
 etc., and nothing will work.  When I specify the filters in the
 build tag, I get no error, but it also doesn't filter.

 Is this an error in the documentation or an issue with 2.2-beta1?  Or
 am I just doing something incorrectly?

 Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Filtering resources in Assembly plugin

2007-09-21 Thread Paul Austin
Will the filtering of dependencySets also be fixed?

Paul

Mick Knutson wrote:
 the filtering filesSets will be fixed in the next release, but you have to
 use files for now. I opened the defect about a month.




 On 9/21/07, Dave Feltenberger [EMAIL PROTECTED] wrote:
   
 I think I found a bug in the assembly plugin.  When I specify a single
 file in my assembly, like so:
 files
 file
 sourcesrc/main/resources/faxing.sh/source
 outputDirectory//outputDirectory
 filteredtrue/filtered
 /file
 /files

 it is filtered properly using the projectbuildfilters.

 But if I specify a fileset, like so:
 fileSets
 fileSet
 directorysrc/main/resources/directory
 outputDirectory//outputDirectory
 includes
 include*.sh/include
 /includes
 filteredtrue/filtered
 /fileSet
 /fileSets

 the resources are *not* filtered.  This isn't intentional, is it?

 Dave

 On 9/21/07, Dave Feltenberger [EMAIL PROTECTED] wrote:
 
 All,

 I'm having an issue filtering resources with the assembly plugin.

 In the documentation at:

   
 http://maven.apache.org/plugins/maven-assembly-plugin/examples/single/filtering-some-distribution-files.html
 
 there is an example of using the assembly plugin.  Here is the part in
 the pom that says how to specify the filter file:

   plugin
 artifactIdmaven-assembly-plugin/artifactId
 configuration
   filters
 filtersrc/assemble/filter.properties/filter
   /filters
   descriptors
 descriptorsrc/assemble/distribution.xml/descriptor
   /descriptors
 /configuration
   /plugin

 When I add a filters tag in my pom in the location specified above,
 I get the following error:
 [INFO] Error configuring:
 org.apache.maven.plugins:maven-assembly-plugin. Reason: ERROR: Cannot
 override read-only parameter: filters in goal: assembly:assembly

 I've tried lots of permutations: adding the filters tag to the
 projectbuild structure, configuring it to run the attached goal,
 etc., and nothing will work.  When I specify the filters in the
 build tag, I get no error, but it also doesn't filter.

 Is this an error in the documentation or an issue with 2.2-beta1?  Or
 am I just doing something incorrectly?

 Dave

   
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 


   


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Filtering resources in Assembly plugin

2007-09-21 Thread Mick Knutson
the filtering filesSets will be fixed in the next release, but you have to
use files for now. I opened the defect about a month.




On 9/21/07, Dave Feltenberger [EMAIL PROTECTED] wrote:

 I think I found a bug in the assembly plugin.  When I specify a single
 file in my assembly, like so:
 files
 file
 sourcesrc/main/resources/faxing.sh/source
 outputDirectory//outputDirectory
 filteredtrue/filtered
 /file
 /files

 it is filtered properly using the projectbuildfilters.

 But if I specify a fileset, like so:
 fileSets
 fileSet
 directorysrc/main/resources/directory
 outputDirectory//outputDirectory
 includes
 include*.sh/include
 /includes
 filteredtrue/filtered
 /fileSet
 /fileSets

 the resources are *not* filtered.  This isn't intentional, is it?

 Dave

 On 9/21/07, Dave Feltenberger [EMAIL PROTECTED] wrote:
  All,
 
  I'm having an issue filtering resources with the assembly plugin.
 
  In the documentation at:
 
 http://maven.apache.org/plugins/maven-assembly-plugin/examples/single/filtering-some-distribution-files.html
 
  there is an example of using the assembly plugin.  Here is the part in
  the pom that says how to specify the filter file:
 
plugin
  artifactIdmaven-assembly-plugin/artifactId
  configuration
filters
  filtersrc/assemble/filter.properties/filter
/filters
descriptors
  descriptorsrc/assemble/distribution.xml/descriptor
/descriptors
  /configuration
/plugin
 
  When I add a filters tag in my pom in the location specified above,
  I get the following error:
  [INFO] Error configuring:
  org.apache.maven.plugins:maven-assembly-plugin. Reason: ERROR: Cannot
  override read-only parameter: filters in goal: assembly:assembly
 
  I've tried lots of permutations: adding the filters tag to the
  projectbuild structure, configuring it to run the attached goal,
  etc., and nothing will work.  When I specify the filters in the
  build tag, I get no error, but it also doesn't filter.
 
  Is this an error in the documentation or an issue with 2.2-beta1?  Or
  am I just doing something incorrectly?
 
  Dave
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 

Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/djmick_dot_com
http://www.myspace.com/sexybeotches
http://www.thumpradio.com
---


Re: Filtering resources into a directory other than classes for a webapp?

2007-06-28 Thread Jared Blitzstein
Yeah, looks like 2.0 doesn't work and when I switched it to 2.0.2 it  
worked right away.


On May 7, 2007, at 12:31 PM, stig.lau wrote:



I was looking for the same solution, and the war-plugin seemed right.
But my config files were always put in the war root instead of the  
folder i

specified.
The solution for me was to use the 2.0.2 version of the war-plugin  
instead

of 2.0.


Heinrich Nirschl wrote:


On Fri, 2007-04-27 at 15:17 -0400, Jared Blitzstein wrote:

Thanks, I've read that as well as http://maven.apache.org/guides/
getting-started/index.html#How%20do%20I%20filter%20resource%20files
and it's basically the same thing as the WAR plugin...I believe.
Since I need this on both the WAR and the exploded app for jetty,  
I'm

not sure if the war plugin is what I need to be using. But the files
are actually being filtered, it's just they're not ending up in / 
WEB-

INF/config/ like I want.  They're going to /WEB-INF/classes/WEB-INF/
config/. Here is the snippet from my pom

filters
filtersrc/main/filters/${env}.var/filter
/filters
resources
resource

directorysrc/main/webapp/WEB-INF/config/directory
filteringtrue/filtering
targetPathWEB-INF/config//targetPath
/resource
/resources


Any ideas?



I have not tried this, but according to the documentation a
configuration similar to this for the war plugin should work:

  plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-war-plugin/artifactId
configuration
  filters
filtersrc/main/filters/${env}.var/filter
  /filters
  webResources
 resource
   !-- the config files you want to filter should be in this
directory --
   directoryconfigurations/directory
   targetPathWEB-INF/config/targetPath
   !-- enable filtering --
   filteringtrue/filtering
 /resource
  /webResources
/configuration
  /plugin

- Henry


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
View this message in context: http://www.nabble.com/Filtering- 
resources-into-a-directory-other-than-classes-for-a-webapp-- 
tf3658613s177.html#a10360724

Sent from the Maven - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: filtering resources in maven-war-plugin

2007-06-14 Thread capira

I have same problem here.

Any ideas?

Regards,

Raul Casado


David Birch wrote:
 
 Hi,
i seem to be getting some strange behaviour with the war plugin
 (versions
 2.0.2  2.0.3-SNAPSHOT), if i do a build with the goal install, the
 resources are filtered properly, if i only go so far as war:exploded or
 war:war, they don't get filtered. I have debugged, and it looks like there
 are 3 steps of calling the plugin in a normal install (trace is below),
 during the first call on the plugin code,  the resources are copied but
 not
 filtered (webResources property is null), but on the subsequent invokes
 the
 resources are filted. When i execute standalone calls to war:exploded or
 war:war, the resources are not filtered - webResources is null  thus the
 filtering code is never invoked.
 FYI - i have tested with both maven 2.0.4  2.0.6
 
 If anyone has any ideas so i can avoid the full install process would be
 great - the wars i have inherited are a little on the large side so all
 the
 construction  copying is a bit of a slowdown.
 
 thanks
 David
 
 the build section of my pom is like so:
 build
 
 filters
 filterbuild.properties/filter
 /filters
 
 resources
 !-- filter the xml  properties resources --
 resource
 filteringtrue/filtering
 directorysrc/main/resources/directory
 includes
 include**/*.xml/include
 include**/*.properties/include
 include**/*.vm/include
 include**/*.txt/include
 /includes
 /resource
 /resources
 
 plugins
 plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-war-plugin/artifactId
 executions
 execution
 goals
 !-- goalcompile/goal
 goalinstall/goal --
 goalwar/goal
 goalexploded/goal
 goalinplace/goal
 /goals
 configuration
 
 warSourceDirectorysrc/main/webapp/warSourceDirectory
 webResources
 resource
 directorysrc/main/webapp/directory
 filteringtrue/filtering
 includes
 include**/*.jsp/include
 include**/*.xml/include
 include**/*.properties/include
 /includes
 /resource
 /webResources
  /configuration
 /execution
 /executions
/plugin
 /plugins
 
 /build
 
 the trace of a std build using the install goal is:
 
 [INFO] [war:war]
 [INFO] Exploding webapp...
 [INFO] Assembling webapp WARTest in
 C:\Java\workspace\TestWARPlugin\target\WARTe
 st-1.0
 [INFO] Copy webapp webResources to
 C:\Java\workspace\TestWARPlugin\target\WARTes
 t-1.0
 [INFO] Generating war
 C:\Java\workspace\TestWARPlugin\target\WARTest-1.0.war
 [INFO] Building war:
 C:\Java\workspace\TestWARPlugin\target\WARTest-1.0.war
 [INFO] [war:war {execution: default}]
 [INFO] Exploding webapp...
 [INFO] Assembling webapp WARTest in
 C:\Java\workspace\TestWARPlugin\target\WARTe
 st-1.0
 [INFO] Copy webapp webResources to
 C:\Java\workspace\TestWARPlugin\target\WARTes
 t-1.0
 [INFO] Copy webapp webResources to
 C:\Java\workspace\TestWARPlugin\target\WARTes
 t-1.0
 [INFO] Generating war
 C:\Java\workspace\TestWARPlugin\target\WARTest-1.0.war
 [INFO] Building war:
 C:\Java\workspace\TestWARPlugin\target\WARTest-1.0.war
 [INFO] [war:exploded {execution: default}]
 WarExplodedMojo by DB
 [INFO] Exploding webapp...
 [INFO] Assembling webapp WARTest in
 C:\Java\workspace\TestWARPlugin\target\WARTe
 st-1.0
 [INFO] Copy webapp webResources to
 C:\Java\workspace\TestWARPlugin\target\WARTes
 t-1.0
 [INFO] Copy webapp webResources to
 C:\Java\workspace\TestWARPlugin\target\WARTes
 t-1.0
 [INFO] [install:install]
 
 

-- 
View this message in context: 
http://www.nabble.com/filtering-resources-in-maven-war-plugin-tf3902334s177.html#a11126738
Sent from the Maven - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Filtering resources into a directory other than classes for a webapp?

2007-05-07 Thread stig.lau

I was looking for the same solution, and the war-plugin seemed right. 
But my config files were always put in the war root instead of the folder i
specified.
The solution for me was to use the 2.0.2 version of the war-plugin instead
of 2.0.


Heinrich Nirschl wrote:
 
 On Fri, 2007-04-27 at 15:17 -0400, Jared Blitzstein wrote:
 Thanks, I've read that as well as http://maven.apache.org/guides/ 
 getting-started/index.html#How%20do%20I%20filter%20resource%20files  
 and it's basically the same thing as the WAR plugin...I believe.  
 Since I need this on both the WAR and the exploded app for jetty, I'm  
 not sure if the war plugin is what I need to be using. But the files  
 are actually being filtered, it's just they're not ending up in /WEB- 
 INF/config/ like I want.  They're going to /WEB-INF/classes/WEB-INF/ 
 config/. Here is the snippet from my pom
 
  filters
  filtersrc/main/filters/${env}.var/filter
  /filters
  resources
  resource
  
 directorysrc/main/webapp/WEB-INF/config/directory
  filteringtrue/filtering
  targetPathWEB-INF/config//targetPath
  /resource
  /resources
 
 
 Any ideas?
 
 
 I have not tried this, but according to the documentation a
 configuration similar to this for the war plugin should work:
 
   plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-war-plugin/artifactId
 configuration
   filters
 filtersrc/main/filters/${env}.var/filter
   /filters
   webResources
  resource
!-- the config files you want to filter should be in this
 directory --
directoryconfigurations/directory 
targetPathWEB-INF/config/targetPath
!-- enable filtering --
filteringtrue/filtering
  /resource
   /webResources
 /configuration
   /plugin
 
 - Henry
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Filtering-resources-into-a-directory-other-than-classes-for-a-webapp--tf3658613s177.html#a10360724
Sent from the Maven - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Filtering resources into a directory other than classes for a webapp?

2007-04-27 Thread Heinrich Nirschl

On 4/27/07, Jared Blitzstein [EMAIL PROTECTED] wrote:

I'm using the webapp archetype and our apps are configured to have
the properties files in /WEB-INF/config/ rather than /WEB-INF/
classes/ which maven defaults to for resource filtering. I see the
targetPath tag in the resource tag but that's only for packages,
not directories outside classes. I tried tricking it with a path
of ../config/ but that only works when it creates the classes
directory, not the WAR or exploded app. Any suggestions to get this
to work without having to run an ant script afterwards to move the
files?


The war plugin can do that. Have a look at
http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html

- Henry

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Filtering resources into a directory other than classes for a webapp?

2007-04-27 Thread Jared Blitzstein
Thanks, I've read that as well as http://maven.apache.org/guides/ 
getting-started/index.html#How%20do%20I%20filter%20resource%20files  
and it's basically the same thing as the WAR plugin...I believe.  
Since I need this on both the WAR and the exploded app for jetty, I'm  
not sure if the war plugin is what I need to be using. But the files  
are actually being filtered, it's just they're not ending up in /WEB- 
INF/config/ like I want.  They're going to /WEB-INF/classes/WEB-INF/ 
config/. Here is the snippet from my pom


filters
filtersrc/main/filters/${env}.var/filter
/filters
resources
resource

directorysrc/main/webapp/WEB-INF/config/directory
filteringtrue/filtering
targetPathWEB-INF/config//targetPath
/resource
/resources


Any ideas?


On Apr 27, 2007, at 12:28 PM, Heinrich Nirschl wrote:


On 4/27/07, Jared Blitzstein [EMAIL PROTECTED] wrote:

I'm using the webapp archetype and our apps are configured to have
the properties files in /WEB-INF/config/ rather than /WEB-INF/
classes/ which maven defaults to for resource filtering. I see the
targetPath tag in the resource tag but that's only for packages,
not directories outside classes. I tried tricking it with a path
of ../config/ but that only works when it creates the classes
directory, not the WAR or exploded app. Any suggestions to get this
to work without having to run an ant script afterwards to move the
files?


The war plugin can do that. Have a look at
http://maven.apache.org/plugins/maven-war-plugin/examples/adding- 
filtering-webresources.html


- Henry

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





Re: Filtering resources into a directory other than classes for a webapp?

2007-04-27 Thread Heinrich Nirschl
On Fri, 2007-04-27 at 15:17 -0400, Jared Blitzstein wrote:
 Thanks, I've read that as well as http://maven.apache.org/guides/ 
 getting-started/index.html#How%20do%20I%20filter%20resource%20files  
 and it's basically the same thing as the WAR plugin...I believe.  
 Since I need this on both the WAR and the exploded app for jetty, I'm  
 not sure if the war plugin is what I need to be using. But the files  
 are actually being filtered, it's just they're not ending up in /WEB- 
 INF/config/ like I want.  They're going to /WEB-INF/classes/WEB-INF/ 
 config/. Here is the snippet from my pom
 
   filters
   filtersrc/main/filters/${env}.var/filter
   /filters
   resources
   resource
   
 directorysrc/main/webapp/WEB-INF/config/directory
   filteringtrue/filtering
   targetPathWEB-INF/config//targetPath
   /resource
   /resources
 
 
 Any ideas?
 

I have not tried this, but according to the documentation a
configuration similar to this for the war plugin should work:

  plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-war-plugin/artifactId
configuration
  filters
filtersrc/main/filters/${env}.var/filter
  /filters
  webResources
 resource
   !-- the config files you want to filter should be in this directory 
--
   directoryconfigurations/directory 
   targetPathWEB-INF/config/targetPath
   !-- enable filtering --
   filteringtrue/filtering
 /resource
  /webResources
/configuration
  /plugin

- Henry


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Filtering resources

2007-03-01 Thread Thomas Colin de Verdière

Thanks you very much it will be good this way.

Thomas

Brad Szabo a écrit :

You can still do all of the Ant work inside of an Ant build file, just
call the ant task, and before you do, you can specify any properties
that you want to be available to Ant, such as:

configuration
tasks
property name=project.build.directory
value=${project.build.directory}/
property name=settings.localRepository
value=${settings.localRepository}/

ant antFile=${basedir}/ant-tasks.xml target=some.target
inheritAll=true inheritRefs=true/
/tasks
/configuration

Note- Be sure inheritAll=true or you will need to specify the
properties as child elements of the ant task.

Good luck,
-Brad

On Wed, 2007-02-28 at 18:44 +0100, Thomas Colin de Verdière wrote:
  
I was using it because i then want to extract files using Ant (you think 
it's ugly) and then merge some jars together. Suppress the version number.

And also merge some files that have the same name into the jars.
We thought about assemblies but they can't do the last file merging stuff.
And in the Ant file we first tried to use artifact:dependencies Ant tags 
but then we get all the transitive dependency (we can't break the 
chain). not the artifact alone.
Ok now i see the solution is to launch ant inside the pom .., i have to 
convince my colleague which is not a very pro maven user :)


Thank you,
Thomas

Brad Szabo a écrit :


Ah. The Maven Resources Plugin only supports filtering using system
properties, project properties, and properties defined in filter
resources.

It does not appear that settings properties are available, which
actually makes sense now that I think about it. I do not think that this
is a bug. Settings properties are not included because they are user
specific. You would not want that information being filtered into the
project artifact.

Why exactly are you trying to generate a build.properties file for
inclusion in the project artifact?

-Brad


On Wed, 2007-02-28 at 17:13 +0100, Thomas Colin de Verdière wrote:
  
  

It works.. it echoes the string.
Here is the part for resources :
resources
  resource
directorybuildproperties/directory
filteringtrue/filtering
  /resource
/resources

And in the buildproperties directory here is the build.properties file 
to filter :

MAVEN_REPO=${settings.mirrors}
MAVEN_REPO=${project.class.name}
MAVEN_REPO=${settings.localRepository}
MAVEN_REPO=${localRepository.class.name}
MAVEN_REPO2=${myrepository}

and it really does generate the file into \target\classes as :
MAVEN_REPO=${settings.mirrors}
MAVEN_REPO=org.apache.maven.project.MavenProject
MAVEN_REPO=${settings.localRepository}
MAVEN_REPO=org.apache.maven.project.MavenProject
MAVEN_REPO2=${settings.localRepository}

Thanks Brad.

Brad Szabo a écrit :



Can you elaborate a little on where you are trying to use
${settings.localRepository}. 


If you add the following AntRun plugin to your pom.xml to echo the
expression value, does it not display the proper path to your local
repository?


  plugin
  artifactIdmaven-antrun-plugin/artifactId
  executions
  execution
phasevalidate/phase
configuration
  tasks
  echo message=settings.localRepository: 
${settings.localRepository}/
  /tasks
/configuration
goals
goalrun/goal
/goals
  /execution
  /executions
  /plugin


Run 'mvn validate' to check the output.

-Brad


On Wed, 2007-02-28 at 16:25 +0100, Thomas Colin de Verdière wrote:
  
  
  

Yes i downloaded Maven 2.0.5

Brad Szabo a écrit :




You are using Maven 2 right?

On Wed, 2007-02-28 at 15:40 +0100, Thomas Colin de Verdière wrote:
  
  
  
  
Thanks but i tried and it didn't work. You are right it is written in 
the document on the maven site. ..


Brad Szabo a écrit :





The localRepository property is configured in settings.xml, therefore
you can access it using ${settings.localRepository}. (The default is
~/.m2/repository). 


Hope this helps,
-Brad

References:
http://maven.apache.org/guides/mini/guide-configuring-maven.html
http://maven.apache.org/settings.html


On Wed, 2007-02-28 at 10:39 +0100, Thomas Colin de Verdière wrote:
  
  
  
  
  

Hello,
i try to filter resources in my project to generate a build.properties file.
I would like to have the path to the localRepository. So i use 
${localRepository} as it is said in BetterBuilds with Maven but it 
doesn't work.

I tried the following properties for testing :
MAVEN_REPO=${project.class.name}
MAVEN_REPO=${localRepository}
MAVEN_REPO=${localRepository.class.name}

and here is the result :

Re: Filtering resources

2007-02-28 Thread Brad Szabo
The localRepository property is configured in settings.xml, therefore
you can access it using ${settings.localRepository}. (The default is
~/.m2/repository). 

Hope this helps,
-Brad

References:
http://maven.apache.org/guides/mini/guide-configuring-maven.html
http://maven.apache.org/settings.html


On Wed, 2007-02-28 at 10:39 +0100, Thomas Colin de Verdière wrote:
 Hello,
 i try to filter resources in my project to generate a build.properties file.
 I would like to have the path to the localRepository. So i use 
 ${localRepository} as it is said in BetterBuilds with Maven but it 
 doesn't work.
 I tried the following properties for testing :
 MAVEN_REPO=${project.class.name}
 MAVEN_REPO=${localRepository}
 MAVEN_REPO=${localRepository.class.name}
 
 and here is the result :
 MAVEN_REPO=org.apache.maven.project.MavenProject
 MAVEN_REPO=${localRepository}
 MAVEN_REPO=org.apache.maven.project.MavenProject
 
 So the localRepository seems to be a 
 org.apache.maven.project.MavenProject  ??
 
 Thanks for helping,
 Thomas
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Filtering resources

2007-02-28 Thread Thomas Colin de Verdière
Thanks but i tried and it didn't work. You are right it is written in 
the document on the maven site. ..


Brad Szabo a écrit :

The localRepository property is configured in settings.xml, therefore
you can access it using ${settings.localRepository}. (The default is
~/.m2/repository). 


Hope this helps,
-Brad

References:
http://maven.apache.org/guides/mini/guide-configuring-maven.html
http://maven.apache.org/settings.html


On Wed, 2007-02-28 at 10:39 +0100, Thomas Colin de Verdière wrote:
  

Hello,
i try to filter resources in my project to generate a build.properties file.
I would like to have the path to the localRepository. So i use 
${localRepository} as it is said in BetterBuilds with Maven but it 
doesn't work.

I tried the following properties for testing :
MAVEN_REPO=${project.class.name}
MAVEN_REPO=${localRepository}
MAVEN_REPO=${localRepository.class.name}

and here is the result :
MAVEN_REPO=org.apache.maven.project.MavenProject
MAVEN_REPO=${localRepository}
MAVEN_REPO=org.apache.maven.project.MavenProject

So the localRepository seems to be a 
org.apache.maven.project.MavenProject  ??


Thanks for helping,
Thomas


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Filtering resources

2007-02-28 Thread Brad Szabo
You are using Maven 2 right?

On Wed, 2007-02-28 at 15:40 +0100, Thomas Colin de Verdière wrote:
 Thanks but i tried and it didn't work. You are right it is written in 
 the document on the maven site. ..
 
 Brad Szabo a écrit :
  The localRepository property is configured in settings.xml, therefore
  you can access it using ${settings.localRepository}. (The default is
  ~/.m2/repository). 
 
  Hope this helps,
  -Brad
 
  References:
  http://maven.apache.org/guides/mini/guide-configuring-maven.html
  http://maven.apache.org/settings.html
 
 
  On Wed, 2007-02-28 at 10:39 +0100, Thomas Colin de Verdière wrote:

  Hello,
  i try to filter resources in my project to generate a build.properties 
  file.
  I would like to have the path to the localRepository. So i use 
  ${localRepository} as it is said in BetterBuilds with Maven but it 
  doesn't work.
  I tried the following properties for testing :
  MAVEN_REPO=${project.class.name}
  MAVEN_REPO=${localRepository}
  MAVEN_REPO=${localRepository.class.name}
 
  and here is the result :
  MAVEN_REPO=org.apache.maven.project.MavenProject
  MAVEN_REPO=${localRepository}
  MAVEN_REPO=org.apache.maven.project.MavenProject
 
  So the localRepository seems to be a 
  org.apache.maven.project.MavenProject  ??
 
  Thanks for helping,
  Thomas
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
  
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Filtering resources

2007-02-28 Thread Thomas Colin de Verdière

Yes i downloaded Maven 2.0.5

Brad Szabo a écrit :

You are using Maven 2 right?

On Wed, 2007-02-28 at 15:40 +0100, Thomas Colin de Verdière wrote:
  
Thanks but i tried and it didn't work. You are right it is written in 
the document on the maven site. ..


Brad Szabo a écrit :


The localRepository property is configured in settings.xml, therefore
you can access it using ${settings.localRepository}. (The default is
~/.m2/repository). 


Hope this helps,
-Brad

References:
http://maven.apache.org/guides/mini/guide-configuring-maven.html
http://maven.apache.org/settings.html


On Wed, 2007-02-28 at 10:39 +0100, Thomas Colin de Verdière wrote:
  
  

Hello,
i try to filter resources in my project to generate a build.properties file.
I would like to have the path to the localRepository. So i use 
${localRepository} as it is said in BetterBuilds with Maven but it 
doesn't work.

I tried the following properties for testing :
MAVEN_REPO=${project.class.name}
MAVEN_REPO=${localRepository}
MAVEN_REPO=${localRepository.class.name}

and here is the result :
MAVEN_REPO=org.apache.maven.project.MavenProject
MAVEN_REPO=${localRepository}
MAVEN_REPO=org.apache.maven.project.MavenProject

So the localRepository seems to be a 
org.apache.maven.project.MavenProject  ??


Thanks for helping,
Thomas


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Filtering resources

2007-02-28 Thread Brad Szabo
Can you elaborate a little on where you are trying to use
${settings.localRepository}. 

If you add the following AntRun plugin to your pom.xml to echo the
expression value, does it not display the proper path to your local
repository?


  plugin
  artifactIdmaven-antrun-plugin/artifactId
  executions
  execution
phasevalidate/phase
configuration
  tasks
  echo message=settings.localRepository: 
${settings.localRepository}/
  /tasks
/configuration
goals
goalrun/goal
/goals
  /execution
  /executions
  /plugin


Run 'mvn validate' to check the output.

-Brad


On Wed, 2007-02-28 at 16:25 +0100, Thomas Colin de Verdière wrote:
 Yes i downloaded Maven 2.0.5
 
 Brad Szabo a écrit :
  You are using Maven 2 right?
 
  On Wed, 2007-02-28 at 15:40 +0100, Thomas Colin de Verdière wrote:

  Thanks but i tried and it didn't work. You are right it is written in 
  the document on the maven site. ..
 
  Brad Szabo a écrit :
  
  The localRepository property is configured in settings.xml, therefore
  you can access it using ${settings.localRepository}. (The default is
  ~/.m2/repository). 
 
  Hope this helps,
  -Brad
 
  References:
  http://maven.apache.org/guides/mini/guide-configuring-maven.html
  http://maven.apache.org/settings.html
 
 
  On Wed, 2007-02-28 at 10:39 +0100, Thomas Colin de Verdière wrote:


  Hello,
  i try to filter resources in my project to generate a build.properties 
  file.
  I would like to have the path to the localRepository. So i use 
  ${localRepository} as it is said in BetterBuilds with Maven but it 
  doesn't work.
  I tried the following properties for testing :
  MAVEN_REPO=${project.class.name}
  MAVEN_REPO=${localRepository}
  MAVEN_REPO=${localRepository.class.name}
 
  and here is the result :
  MAVEN_REPO=org.apache.maven.project.MavenProject
  MAVEN_REPO=${localRepository}
  MAVEN_REPO=org.apache.maven.project.MavenProject
 
  So the localRepository seems to be a 
  org.apache.maven.project.MavenProject  ??
 
  Thanks for helping,
  Thomas
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
  
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
  
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Filtering resources

2007-02-28 Thread Thomas Colin de Verdière

It works.. it echoes the string.
Here is the part for resources :
   resources
 resource
   directorybuildproperties/directory
   filteringtrue/filtering
 /resource
   /resources

And in the buildproperties directory here is the build.properties file 
to filter :

MAVEN_REPO=${settings.mirrors}
MAVEN_REPO=${project.class.name}
MAVEN_REPO=${settings.localRepository}
MAVEN_REPO=${localRepository.class.name}
MAVEN_REPO2=${myrepository}

and it really does generate the file into \target\classes as :
MAVEN_REPO=${settings.mirrors}
MAVEN_REPO=org.apache.maven.project.MavenProject
MAVEN_REPO=${settings.localRepository}
MAVEN_REPO=org.apache.maven.project.MavenProject
MAVEN_REPO2=${settings.localRepository}

Thanks Brad.

Brad Szabo a écrit :

Can you elaborate a little on where you are trying to use
${settings.localRepository}. 


If you add the following AntRun plugin to your pom.xml to echo the
expression value, does it not display the proper path to your local
repository?


  plugin
  artifactIdmaven-antrun-plugin/artifactId
  executions
  execution
phasevalidate/phase
configuration
  tasks
  echo message=settings.localRepository: 
${settings.localRepository}/
  /tasks
/configuration
goals
goalrun/goal
/goals
  /execution
  /executions
  /plugin


Run 'mvn validate' to check the output.

-Brad


On Wed, 2007-02-28 at 16:25 +0100, Thomas Colin de Verdière wrote:
  

Yes i downloaded Maven 2.0.5

Brad Szabo a écrit :


You are using Maven 2 right?

On Wed, 2007-02-28 at 15:40 +0100, Thomas Colin de Verdière wrote:
  
  
Thanks but i tried and it didn't work. You are right it is written in 
the document on the maven site. ..


Brad Szabo a écrit :



The localRepository property is configured in settings.xml, therefore
you can access it using ${settings.localRepository}. (The default is
~/.m2/repository). 


Hope this helps,
-Brad

References:
http://maven.apache.org/guides/mini/guide-configuring-maven.html
http://maven.apache.org/settings.html


On Wed, 2007-02-28 at 10:39 +0100, Thomas Colin de Verdière wrote:
  
  
  

Hello,
i try to filter resources in my project to generate a build.properties file.
I would like to have the path to the localRepository. So i use 
${localRepository} as it is said in BetterBuilds with Maven but it 
doesn't work.

I tried the following properties for testing :
MAVEN_REPO=${project.class.name}
MAVEN_REPO=${localRepository}
MAVEN_REPO=${localRepository.class.name}

and here is the result :
MAVEN_REPO=org.apache.maven.project.MavenProject
MAVEN_REPO=${localRepository}
MAVEN_REPO=org.apache.maven.project.MavenProject

So the localRepository seems to be a 
org.apache.maven.project.MavenProject  ??


Thanks for helping,
Thomas


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Filtering resources

2007-02-28 Thread Brad Szabo
Ah. The Maven Resources Plugin only supports filtering using system
properties, project properties, and properties defined in filter
resources.

It does not appear that settings properties are available, which
actually makes sense now that I think about it. I do not think that this
is a bug. Settings properties are not included because they are user
specific. You would not want that information being filtered into the
project artifact.

Why exactly are you trying to generate a build.properties file for
inclusion in the project artifact?

-Brad


On Wed, 2007-02-28 at 17:13 +0100, Thomas Colin de Verdière wrote:
 It works.. it echoes the string.
 Here is the part for resources :
 resources
   resource
 directorybuildproperties/directory
 filteringtrue/filtering
   /resource
 /resources
 
 And in the buildproperties directory here is the build.properties file 
 to filter :
 MAVEN_REPO=${settings.mirrors}
 MAVEN_REPO=${project.class.name}
 MAVEN_REPO=${settings.localRepository}
 MAVEN_REPO=${localRepository.class.name}
 MAVEN_REPO2=${myrepository}
 
 and it really does generate the file into \target\classes as :
 MAVEN_REPO=${settings.mirrors}
 MAVEN_REPO=org.apache.maven.project.MavenProject
 MAVEN_REPO=${settings.localRepository}
 MAVEN_REPO=org.apache.maven.project.MavenProject
 MAVEN_REPO2=${settings.localRepository}
 
 Thanks Brad.
 
 Brad Szabo a écrit :
  Can you elaborate a little on where you are trying to use
  ${settings.localRepository}. 
 
  If you add the following AntRun plugin to your pom.xml to echo the
  expression value, does it not display the proper path to your local
  repository?
 
 
plugin
artifactIdmaven-antrun-plugin/artifactId
executions
execution
  phasevalidate/phase
  configuration
tasks
echo message=settings.localRepository: 
  ${settings.localRepository}/
/tasks
  /configuration
  goals
  goalrun/goal
  /goals
/execution
/executions
/plugin
 
 
  Run 'mvn validate' to check the output.
 
  -Brad
 
 
  On Wed, 2007-02-28 at 16:25 +0100, Thomas Colin de Verdière wrote:

  Yes i downloaded Maven 2.0.5
 
  Brad Szabo a écrit :
  
  You are using Maven 2 right?
 
  On Wed, 2007-02-28 at 15:40 +0100, Thomas Colin de Verdière wrote:


  Thanks but i tried and it didn't work. You are right it is written in 
  the document on the maven site. ..
 
  Brad Szabo a écrit :
  
  
  The localRepository property is configured in settings.xml, therefore
  you can access it using ${settings.localRepository}. (The default is
  ~/.m2/repository). 
 
  Hope this helps,
  -Brad
 
  References:
  http://maven.apache.org/guides/mini/guide-configuring-maven.html
  http://maven.apache.org/settings.html
 
 
  On Wed, 2007-02-28 at 10:39 +0100, Thomas Colin de Verdière wrote:



  Hello,
  i try to filter resources in my project to generate a build.properties 
  file.
  I would like to have the path to the localRepository. So i use 
  ${localRepository} as it is said in BetterBuilds with Maven but it 
  doesn't work.
  I tried the following properties for testing :
  MAVEN_REPO=${project.class.name}
  MAVEN_REPO=${localRepository}
  MAVEN_REPO=${localRepository.class.name}
 
  and here is the result :
  MAVEN_REPO=org.apache.maven.project.MavenProject
  MAVEN_REPO=${localRepository}
  MAVEN_REPO=org.apache.maven.project.MavenProject
 
  So the localRepository seems to be a 
  org.apache.maven.project.MavenProject  ??
 
  Thanks for helping,
  Thomas
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
  
  
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
  
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
  
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 
 
 

Re: Filtering resources

2007-02-28 Thread Thierry Lach

Actually settings properties not being available in filtering might cause us
some problems in converting to M2.

Each of our developers has their own oracle schema that they can do unit
testing against (dbunit).  In M1 we put the connection strings into
build.properties.  We copy unit test property files from
src/test/resources/properties into target/test-resources/properties,
replacing in the user-specific connection strings.  As part of converting to
M2, I was planning on putting those connection strings into settings.xml.
It's going to be somewhat more complicated for me not being able to use
them.

On 2/28/07, Brad Szabo [EMAIL PROTECTED] wrote:


Ah. The Maven Resources Plugin only supports filtering using system
properties, project properties, and properties defined in filter
resources.

It does not appear that settings properties are available, which
actually makes sense now that I think about it. I do not think that this
is a bug. Settings properties are not included because they are user
specific. You would not want that information being filtered into the
project artifact.

Why exactly are you trying to generate a build.properties file for
inclusion in the project artifact?

-Brad


On Wed, 2007-02-28 at 17:13 +0100, Thomas Colin de Verdière wrote:
 It works.. it echoes the string.
 Here is the part for resources :
 resources
   resource
 directorybuildproperties/directory
 filteringtrue/filtering
   /resource
 /resources

 And in the buildproperties directory here is the build.properties file
 to filter :
 MAVEN_REPO=${settings.mirrors}
 MAVEN_REPO=${project.class.name}
 MAVEN_REPO=${settings.localRepository}
 MAVEN_REPO=${localRepository.class.name}
 MAVEN_REPO2=${myrepository}

 and it really does generate the file into \target\classes as :
 MAVEN_REPO=${settings.mirrors}
 MAVEN_REPO=org.apache.maven.project.MavenProject
 MAVEN_REPO=${settings.localRepository}
 MAVEN_REPO=org.apache.maven.project.MavenProject
 MAVEN_REPO2=${settings.localRepository}

 Thanks Brad.

 Brad Szabo a écrit :
  Can you elaborate a little on where you are trying to use
  ${settings.localRepository}.
 
  If you add the following AntRun plugin to your pom.xml to echo the
  expression value, does it not display the proper path to your local
  repository?
 
 
plugin
artifactIdmaven-antrun-plugin/artifactId
executions
execution
  phasevalidate/phase
  configuration
tasks
echo message=settings.localRepository: ${
settings.localRepository}/
/tasks
  /configuration
  goals
  goalrun/goal
  /goals
/execution
/executions
/plugin
 
 
  Run 'mvn validate' to check the output.
 
  -Brad
 
 
  On Wed, 2007-02-28 at 16:25 +0100, Thomas Colin de Verdière wrote:
 
  Yes i downloaded Maven 2.0.5
 
  Brad Szabo a écrit :
 
  You are using Maven 2 right?
 
  On Wed, 2007-02-28 at 15:40 +0100, Thomas Colin de Verdière wrote:
 
 
  Thanks but i tried and it didn't work. You are right it is written
in
  the document on the maven site. ..
 
  Brad Szabo a écrit :
 
 
  The localRepository property is configured in settings.xml,
therefore
  you can access it using ${settings.localRepository}. (The default
is
  ~/.m2/repository).
 
  Hope this helps,
  -Brad
 
  References:
  http://maven.apache.org/guides/mini/guide-configuring-maven.html
  http://maven.apache.org/settings.html
 
 
  On Wed, 2007-02-28 at 10:39 +0100, Thomas Colin de Verdière wrote:
 
 
 
  Hello,
  i try to filter resources in my project to generate a
build.properties file.
  I would like to have the path to the localRepository. So i use
  ${localRepository} as it is said in BetterBuilds with Maven but
it
  doesn't work.
  I tried the following properties for testing :
  MAVEN_REPO=${project.class.name}
  MAVEN_REPO=${localRepository}
  MAVEN_REPO=${localRepository.class.name}
 
  and here is the result :
  MAVEN_REPO=org.apache.maven.project.MavenProject
  MAVEN_REPO=${localRepository}
  MAVEN_REPO=org.apache.maven.project.MavenProject
 
  So the localRepository seems to be a
  org.apache.maven.project.MavenProject  ??
 
  Thanks for helping,
  Thomas
 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 

Re: Filtering resources

2007-02-28 Thread Thomas Colin de Verdière
I was using it because i then want to extract files using Ant (you think 
it's ugly) and then merge some jars together. Suppress the version number.

And also merge some files that have the same name into the jars.
We thought about assemblies but they can't do the last file merging stuff.
And in the Ant file we first tried to use artifact:dependencies Ant tags 
but then we get all the transitive dependency (we can't break the 
chain). not the artifact alone.
Ok now i see the solution is to launch ant inside the pom .., i have to 
convince my colleague which is not a very pro maven user :)


Thank you,
Thomas

Brad Szabo a écrit :

Ah. The Maven Resources Plugin only supports filtering using system
properties, project properties, and properties defined in filter
resources.

It does not appear that settings properties are available, which
actually makes sense now that I think about it. I do not think that this
is a bug. Settings properties are not included because they are user
specific. You would not want that information being filtered into the
project artifact.

Why exactly are you trying to generate a build.properties file for
inclusion in the project artifact?

-Brad


On Wed, 2007-02-28 at 17:13 +0100, Thomas Colin de Verdière wrote:
  

It works.. it echoes the string.
Here is the part for resources :
resources
  resource
directorybuildproperties/directory
filteringtrue/filtering
  /resource
/resources

And in the buildproperties directory here is the build.properties file 
to filter :

MAVEN_REPO=${settings.mirrors}
MAVEN_REPO=${project.class.name}
MAVEN_REPO=${settings.localRepository}
MAVEN_REPO=${localRepository.class.name}
MAVEN_REPO2=${myrepository}

and it really does generate the file into \target\classes as :
MAVEN_REPO=${settings.mirrors}
MAVEN_REPO=org.apache.maven.project.MavenProject
MAVEN_REPO=${settings.localRepository}
MAVEN_REPO=org.apache.maven.project.MavenProject
MAVEN_REPO2=${settings.localRepository}

Thanks Brad.

Brad Szabo a écrit :


Can you elaborate a little on where you are trying to use
${settings.localRepository}. 


If you add the following AntRun plugin to your pom.xml to echo the
expression value, does it not display the proper path to your local
repository?


  plugin
  artifactIdmaven-antrun-plugin/artifactId
  executions
  execution
phasevalidate/phase
configuration
  tasks
  echo message=settings.localRepository: 
${settings.localRepository}/
  /tasks
/configuration
goals
goalrun/goal
/goals
  /execution
  /executions
  /plugin


Run 'mvn validate' to check the output.

-Brad


On Wed, 2007-02-28 at 16:25 +0100, Thomas Colin de Verdière wrote:
  
  

Yes i downloaded Maven 2.0.5

Brad Szabo a écrit :



You are using Maven 2 right?

On Wed, 2007-02-28 at 15:40 +0100, Thomas Colin de Verdière wrote:
  
  
  
Thanks but i tried and it didn't work. You are right it is written in 
the document on the maven site. ..


Brad Szabo a écrit :




The localRepository property is configured in settings.xml, therefore
you can access it using ${settings.localRepository}. (The default is
~/.m2/repository). 


Hope this helps,
-Brad

References:
http://maven.apache.org/guides/mini/guide-configuring-maven.html
http://maven.apache.org/settings.html


On Wed, 2007-02-28 at 10:39 +0100, Thomas Colin de Verdière wrote:
  
  
  
  

Hello,
i try to filter resources in my project to generate a build.properties file.
I would like to have the path to the localRepository. So i use 
${localRepository} as it is said in BetterBuilds with Maven but it 
doesn't work.

I tried the following properties for testing :
MAVEN_REPO=${project.class.name}
MAVEN_REPO=${localRepository}
MAVEN_REPO=${localRepository.class.name}

and here is the result :
MAVEN_REPO=org.apache.maven.project.MavenProject
MAVEN_REPO=${localRepository}
MAVEN_REPO=org.apache.maven.project.MavenProject

So the localRepository seems to be a 
org.apache.maven.project.MavenProject  ??


Thanks for helping,
Thomas


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






Re: Filtering resources

2007-02-28 Thread Brad Szabo
You can still do all of the Ant work inside of an Ant build file, just
call the ant task, and before you do, you can specify any properties
that you want to be available to Ant, such as:

configuration
tasks
property name=project.build.directory
value=${project.build.directory}/
property name=settings.localRepository
value=${settings.localRepository}/

ant antFile=${basedir}/ant-tasks.xml target=some.target
inheritAll=true inheritRefs=true/
/tasks
/configuration

Note- Be sure inheritAll=true or you will need to specify the
properties as child elements of the ant task.

Good luck,
-Brad

On Wed, 2007-02-28 at 18:44 +0100, Thomas Colin de Verdière wrote:
 I was using it because i then want to extract files using Ant (you think 
 it's ugly) and then merge some jars together. Suppress the version number.
 And also merge some files that have the same name into the jars.
 We thought about assemblies but they can't do the last file merging stuff.
 And in the Ant file we first tried to use artifact:dependencies Ant tags 
 but then we get all the transitive dependency (we can't break the 
 chain). not the artifact alone.
 Ok now i see the solution is to launch ant inside the pom .., i have to 
 convince my colleague which is not a very pro maven user :)
 
 Thank you,
 Thomas
 
 Brad Szabo a écrit :
  Ah. The Maven Resources Plugin only supports filtering using system
  properties, project properties, and properties defined in filter
  resources.
 
  It does not appear that settings properties are available, which
  actually makes sense now that I think about it. I do not think that this
  is a bug. Settings properties are not included because they are user
  specific. You would not want that information being filtered into the
  project artifact.
 
  Why exactly are you trying to generate a build.properties file for
  inclusion in the project artifact?
 
  -Brad
 
 
  On Wed, 2007-02-28 at 17:13 +0100, Thomas Colin de Verdière wrote:

  It works.. it echoes the string.
  Here is the part for resources :
  resources
resource
  directorybuildproperties/directory
  filteringtrue/filtering
/resource
  /resources
 
  And in the buildproperties directory here is the build.properties file 
  to filter :
  MAVEN_REPO=${settings.mirrors}
  MAVEN_REPO=${project.class.name}
  MAVEN_REPO=${settings.localRepository}
  MAVEN_REPO=${localRepository.class.name}
  MAVEN_REPO2=${myrepository}
 
  and it really does generate the file into \target\classes as :
  MAVEN_REPO=${settings.mirrors}
  MAVEN_REPO=org.apache.maven.project.MavenProject
  MAVEN_REPO=${settings.localRepository}
  MAVEN_REPO=org.apache.maven.project.MavenProject
  MAVEN_REPO2=${settings.localRepository}
 
  Thanks Brad.
 
  Brad Szabo a écrit :
  
  Can you elaborate a little on where you are trying to use
  ${settings.localRepository}. 
 
  If you add the following AntRun plugin to your pom.xml to echo the
  expression value, does it not display the proper path to your local
  repository?
 
 
plugin
artifactIdmaven-antrun-plugin/artifactId
executions
execution
  phasevalidate/phase
  configuration
tasks
echo message=settings.localRepository: 
  ${settings.localRepository}/
/tasks
  /configuration
  goals
  goalrun/goal
  /goals
/execution
/executions
/plugin
 
 
  Run 'mvn validate' to check the output.
 
  -Brad
 
 
  On Wed, 2007-02-28 at 16:25 +0100, Thomas Colin de Verdière wrote:


  Yes i downloaded Maven 2.0.5
 
  Brad Szabo a écrit :
  
  
  You are using Maven 2 right?
 
  On Wed, 2007-02-28 at 15:40 +0100, Thomas Colin de Verdière wrote:



  Thanks but i tried and it didn't work. You are right it is written in 
  the document on the maven site. ..
 
  Brad Szabo a écrit :
  
  
  
  The localRepository property is configured in settings.xml, therefore
  you can access it using ${settings.localRepository}. (The default is
  ~/.m2/repository). 
 
  Hope this helps,
  -Brad
 
  References:
  http://maven.apache.org/guides/mini/guide-configuring-maven.html
  http://maven.apache.org/settings.html
 
 
  On Wed, 2007-02-28 at 10:39 +0100, Thomas Colin de Verdière wrote:




  Hello,
  i try to filter resources in my project to generate a 
  build.properties file.
  I would like to have the path to the localRepository. So i use 
  ${localRepository} as it is said in BetterBuilds with Maven but it 
  doesn't work.
  I tried the following properties for testing :
  MAVEN_REPO=${project.class.name}
  MAVEN_REPO=${localRepository}
  

Re: Filtering resources and timestamp?

2006-05-15 Thread Wayne Fay

This has been asked before, a few times in the last few months, and no
one has answered with a solution. Search the User archive to see this
for yourself.

So I'm inclined to think this is not currently possible.

Wayne

On 5/15/06, David Hay [EMAIL PROTECTED] wrote:

I haven't seen this question addressed in the past.  What I'd like to do is
filter a properties file I have and place the timestamp of when the build
occurred.  That is, in src/main/resources, I would like to have a properties
file with a line like:

buildTime=${project.buildTime}

and have it replaced with the time of the build.  Is there an existing
property or plugin that will allow me to do this?

Thanks!
David

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Filtering resources and timestamp?

2006-05-15 Thread Julian Wood

You can use the maven-buildnumber-plugin to do this.

http://commons.ucalgary.ca/projects/maven-buildnumber-plugin

J

On 15-May-06, at 3:09 PM, Wayne Fay wrote:


This has been asked before, a few times in the last few months, and no
one has answered with a solution. Search the User archive to see this
for yourself.

So I'm inclined to think this is not currently possible.

Wayne

On 5/15/06, David Hay [EMAIL PROTECTED] wrote:
I haven't seen this question addressed in the past.  What I'd like  
to do is
filter a properties file I have and place the timestamp of when  
the build
occurred.  That is, in src/main/resources, I would like to have a  
properties

file with a line like:

buildTime=${project.buildTime}

and have it replaced with the time of the build.  Is there an  
existing

property or plugin that will allow me to do this?

Thanks!
David

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
Julian Wood [EMAIL PROTECTED]

Software Engineer
Teaching  Learning Centre
University of Calgary

http://tlc.ucalgary.ca



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: filtering resources resources

2006-01-18 Thread Tom Joad
Hello Alexandre,
I already try this. I have the same error.
 mvn -e -X process-resources -Dcommand.line.prop=Hi man

+ Error stacktraces are turned on.
[DEBUG] Building Maven user-level plugin registry from:
'/home/maven/.m2/plugin-registry.xml'
[DEBUG] Building Maven global-level plugin registry from:
'/usr/local/maven-2.0.2/conf/plugin-registry.xml'
[INFO] Scanning for projects...
[INFO] 

[ERROR] BUILD FAILURE
[INFO] 

[INFO] Invalid task 'man': you must specify a valid lifecycle phase,
or a goal in the format plugin:goal or
pluginGroupId:pluginArtifactId:pluginVersion:goal
[INFO] 




2006/1/17, Alexandre Poitras [EMAIL PROTECTED]:
 /home/maven/maki # mvn -e -X process-resources -Dcommand.line.prop=Hi man
 should be
 /home/maven/maki # mvn -e -X process-resources -Dcommand.line.prop=Hi man

 On 1/17/06, Tom Joad [EMAIL PROTECTED] wrote:
  Hi,
  I have just installed mvn 2.0.2 on linux mandrake 10 and I follow
  getting started documentation to refresh my knowledges on maven
  possibility.I'm on filtering resources paragraph , and try to use java
  - D parameter . the command line on the documentation does not work.
  because of the white space on parameter value. Maven takes the last
  string (here man) as a goal of a lifecycle phase error message i get
  is
  /home/maven/maki # mvn -e -X process-resources -Dcommand.line.prop=Hi man
  + Error stacktraces are turned on.
  [DEBUG] Building Maven user-level plugin registry from:
  '/home/maven/.m2/plugin-registry.xml'
  [DEBUG] Building Maven global-level plugin registry from:
  '/usr/local/maven-2.0.2/conf/plugin-registry.xml'
  [INFO] Scanning for projects...
  [INFO] 
  
  [ERROR] BUILD FAILURE
  [INFO] 
  
  [INFO] Invalid task 'man': you must specify a valid lifecycle phase,
  or a goal in the format plugin:goal or
  pluginGroupId:pluginArtifactId:pluginVersion:goal
  [INFO] 
  
  [DEBUG] Trace
  Is it a known problem (Minor I admit it)
 
  Tom.
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 --
 Alexandre Poitras
 Québec, Canada

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: filtering resources resources

2006-01-17 Thread Alexandre Poitras
/home/maven/maki # mvn -e -X process-resources -Dcommand.line.prop=Hi man
should be
/home/maven/maki # mvn -e -X process-resources -Dcommand.line.prop=Hi man

On 1/17/06, Tom Joad [EMAIL PROTECTED] wrote:
 Hi,
 I have just installed mvn 2.0.2 on linux mandrake 10 and I follow
 getting started documentation to refresh my knowledges on maven
 possibility.I'm on filtering resources paragraph , and try to use java
 - D parameter . the command line on the documentation does not work.
 because of the white space on parameter value. Maven takes the last
 string (here man) as a goal of a lifecycle phase error message i get
 is
 /home/maven/maki # mvn -e -X process-resources -Dcommand.line.prop=Hi man
 + Error stacktraces are turned on.
 [DEBUG] Building Maven user-level plugin registry from:
 '/home/maven/.m2/plugin-registry.xml'
 [DEBUG] Building Maven global-level plugin registry from:
 '/usr/local/maven-2.0.2/conf/plugin-registry.xml'
 [INFO] Scanning for projects...
 [INFO] 
 
 [ERROR] BUILD FAILURE
 [INFO] 
 
 [INFO] Invalid task 'man': you must specify a valid lifecycle phase,
 or a goal in the format plugin:goal or
 pluginGroupId:pluginArtifactId:pluginVersion:goal
 [INFO] 
 
 [DEBUG] Trace
 Is it a known problem (Minor I admit it)

 Tom.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




--
Alexandre Poitras
Québec, Canada

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Filtering resources

2006-01-13 Thread Karthik V
there seems to be one (
http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html ) ..
but isnt it possible to do it after compilation, when the jar happens?
assuming i need the other classes too for some other purpose (but dont want
it inside the jar), is there no way of achieving this at all?


On 1/12/06, Brian E. Fox [EMAIL PROTECTED] wrote:

 Isn't there an exclude sources setting in the compiler?

 -Original Message-
 From: Karthik V [mailto:[EMAIL PROTECTED]
 Sent: Thursday, January 12, 2006 11:12 AM
 To: Maven Users List
 Subject: Re: Filtering resources

 can some one answer this please?


 On 1/11/06, Karthik V [EMAIL PROTECTED] wrote:
 
  ok .. that 2nd question was silly .. i managed it ... pls help me wth
  the 1st one.
 
 
  On 1/11/06, Karthik V  [EMAIL PROTECTED] wrote:
  
   In m2, how do I prevent some classes from being included to the
   final jar file?
  
   Also, I need to add some files (like the xmls generated by xdoclet)
   to the jar. These files go to the generated-sources directory and
   not to the src/main/resources. How do I add these to the final jar?
 
 
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Filtering resources

2006-01-13 Thread John Casey
Well, looking at the jar plugin, it seems that it doesn't allow 
inclusions/exclusions to be specified.


I guess my question is, what are you trying to accomplish? Are these 
classes unit tests or something?


-john

Karthik V wrote:

there seems to be one (
http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html ) ..
but isnt it possible to do it after compilation, when the jar happens?
assuming i need the other classes too for some other purpose (but dont want
it inside the jar), is there no way of achieving this at all?


On 1/12/06, Brian E. Fox [EMAIL PROTECTED] wrote:

Isn't there an exclude sources setting in the compiler?

-Original Message-
From: Karthik V [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 12, 2006 11:12 AM
To: Maven Users List
Subject: Re: Filtering resources

can some one answer this please?


On 1/11/06, Karthik V [EMAIL PROTECTED] wrote:

ok .. that 2nd question was silly .. i managed it ... pls help me wth
the 1st one.


On 1/11/06, Karthik V  [EMAIL PROTECTED] wrote:

In m2, how do I prevent some classes from being included to the
final jar file?

Also, I need to add some files (like the xmls generated by xdoclet)
to the jar. These files go to the generated-sources directory and
not to the src/main/resources. How do I add these to the final jar?





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Filtering resources

2006-01-13 Thread Karthik V
I want the remaining classes to go into another jar ...  It can be made as a
different project, but that'll repeat the compilation and source generation
processes ...  I thought if I can exclude these classes from the 1st jar, I
can either generate another jar file wth the rest of the classes, or copy
those classes into a 2nd project's resource folder (so that its jarred up at
the end).

I'm actually converting an ant project that produces a bunch of classes and
packs them into 2 different jars by using include/exclude in the jar task
...  I'm not particular about how this is accomplished, all I want is a
solution ... I tried posting this problem in different forms to this list,
but never got a satisfactory reply 




On 1/13/06, John Casey [EMAIL PROTECTED] wrote:

 Well, looking at the jar plugin, it seems that it doesn't allow
 inclusions/exclusions to be specified.

 I guess my question is, what are you trying to accomplish? Are these
 classes unit tests or something?

 -john

 Karthik V wrote:
  there seems to be one (
  http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html) ..
  but isnt it possible to do it after compilation, when the jar happens?
  assuming i need the other classes too for some other purpose (but dont
 want
  it inside the jar), is there no way of achieving this at all?
 
 
  On 1/12/06, Brian E. Fox [EMAIL PROTECTED] wrote:
  Isn't there an exclude sources setting in the compiler?
 
  -Original Message-
  From: Karthik V [mailto:[EMAIL PROTECTED]
  Sent: Thursday, January 12, 2006 11:12 AM
  To: Maven Users List
  Subject: Re: Filtering resources
 
  can some one answer this please?
 
 
  On 1/11/06, Karthik V [EMAIL PROTECTED] wrote:
  ok .. that 2nd question was silly .. i managed it ... pls help me wth
  the 1st one.
 
 
  On 1/11/06, Karthik V  [EMAIL PROTECTED] wrote:
  In m2, how do I prevent some classes from being included to the
  final jar file?
 
  Also, I need to add some files (like the xmls generated by xdoclet)
  to the jar. These files go to the generated-sources directory and
  not to the src/main/resources. How do I add these to the final jar?
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Filtering resources

2006-01-13 Thread Karthik V
thanks .. i'll try using that ... can u give me a link that explains how to
use it?


On 1/13/06, dan tran [EMAIL PROTECTED] wrote:

 I use antrunt to remove those classes in the process of migrating
 ant/make builds  to maven.

 Hopefully, I dont need it any more soon.

 -D



 On 1/13/06, John Casey [EMAIL PROTECTED] wrote:
 
  Well, looking at the jar plugin, it seems that it doesn't allow
  inclusions/exclusions to be specified.
 
  I guess my question is, what are you trying to accomplish? Are these
  classes unit tests or something?
 
  -john
 
  Karthik V wrote:
   there seems to be one (
  
 http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html)..
   but isnt it possible to do it after compilation, when the jar happens?
   assuming i need the other classes too for some other purpose (but dont
  want
   it inside the jar), is there no way of achieving this at all?
  
  
   On 1/12/06, Brian E. Fox [EMAIL PROTECTED] wrote:
   Isn't there an exclude sources setting in the compiler?
  
   -Original Message-
   From: Karthik V [mailto:[EMAIL PROTECTED]
   Sent: Thursday, January 12, 2006 11:12 AM
   To: Maven Users List
   Subject: Re: Filtering resources
  
   can some one answer this please?
  
  
   On 1/11/06, Karthik V [EMAIL PROTECTED] wrote:
   ok .. that 2nd question was silly .. i managed it ... pls help me
 wth
   the 1st one.
  
  
   On 1/11/06, Karthik V  [EMAIL PROTECTED] wrote:
   In m2, how do I prevent some classes from being included to the
   final jar file?
  
   Also, I need to add some files (like the xmls generated by xdoclet)
   to the jar. These files go to the generated-sources directory and
   not to the src/main/resources. How do I add these to the final jar?
  
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 




Re: Filtering resources

2006-01-12 Thread Karthik V
can some one answer this please?


On 1/11/06, Karthik V [EMAIL PROTECTED] wrote:

 ok .. that 2nd question was silly .. i managed it ... pls help me wth the
 1st one.


 On 1/11/06, Karthik V  [EMAIL PROTECTED] wrote:
 
  In m2, how do I prevent some classes from being included to the final
  jar file?
 
  Also, I need to add some files (like the xmls generated by xdoclet) to
  the jar. These files go to the generated-sources directory and not to the
  src/main/resources. How do I add these to the final jar?





RE: Filtering resources

2006-01-12 Thread Brian E. Fox
Isn't there an exclude sources setting in the compiler? 

-Original Message-
From: Karthik V [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 12, 2006 11:12 AM
To: Maven Users List
Subject: Re: Filtering resources

can some one answer this please?


On 1/11/06, Karthik V [EMAIL PROTECTED] wrote:

 ok .. that 2nd question was silly .. i managed it ... pls help me wth 
 the 1st one.


 On 1/11/06, Karthik V  [EMAIL PROTECTED] wrote:
 
  In m2, how do I prevent some classes from being included to the 
  final jar file?
 
  Also, I need to add some files (like the xmls generated by xdoclet) 
  to the jar. These files go to the generated-sources directory and 
  not to the src/main/resources. How do I add these to the final jar?





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Filtering resources

2006-01-11 Thread Karthik V
ok .. that 2nd question was silly .. i managed it ... pls help me wth the
1st one.


On 1/11/06, Karthik V [EMAIL PROTECTED] wrote:

 In m2, how do I prevent some classes from being included to the final jar
 file?

 Also, I need to add some files (like the xmls generated by xdoclet) to the
 jar. These files go to the generated-sources directory and not to the
 src/main/resources. How do I add these to the final jar?