Re: Filtering resources

2016-01-14 Thread Thomas Sundberg
Hi!

On 13 January 2016 at 19:01, Robert Scholte <rfscho...@apache.org> 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 <t...@kth.se>:
>
>
>> 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 <james.a.hut...@gmail.com>
>> 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 <m...@batmat.net> 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 <gudnabr...@gmail.com>:
>>>>
>>>> > 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 <t...@kth.se> 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
>>>> > >
>>>>

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 <t...@kth.se> wrote:

> Hi!
>
> On 13 January 2016 at 19:01, Robert Scholte <rfscho...@apache.org> 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 <t...@kth.se>:
> >
> >
> >> 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 <james.a.hut...@gmail.com>
> >> 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 <m...@batmat.net>
> 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 <gudnabr...@gmail.com>:
> >>>>
> >>>> > 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 <t...@kth.se>
> wrote:
> >>>> > > Hi!
> >>>> > >
> >>>> > > I need to be able to filter files where the values to replace are
> >>>> defind
> >>>> > as
> >>>> > >
> >>>> > > @aPlaceHolderT

Re: Filtering resources

2016-01-14 Thread Thomas Sundberg
Hi!

On 14 January 2016 at 15:09, Stephen Connolly
<stephen.alan.conno...@gmail.com> 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 <t...@kth.se> wrote:
>
>> Hi!
>>
>> On 13 January 2016 at 19:01, Robert Scholte <rfscho...@apache.org> 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 <t...@kth.se>:
>> >
>> >
>> >> 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 <james.a.hut...@gmail.com>
>> >> wrote:
>> >>>
>> >>> You could also look at DefaultMavenResourcesFiltering
>> >>>
>> >>

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 <james.a.hut...@gmail.com> 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 <m...@batmat.net> 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 <gudnabr...@gmail.com>:
>>
>> > 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 <t...@kth.se> 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 <t...@kth.se>:


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 <james.a.hut...@gmail.com>  
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 <m...@batmat.net> 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 <gudnabr...@gmail.com>:

> 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 <t...@kth.se> 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



Filtering resources

2016-01-12 Thread Thomas Sundberg
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



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



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

2014-09-16 Thread Martin Todorov
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


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 !


filtering resources in a war

2009-09-16 Thread Manuel Grau


Hi all,

I'm trying to filter some jsp files in my war project. The jsp file  
I'm tyring to filter is located in src/main/webapp/WEB-INF/includes/ 
header.jsp. This is my pom.xml maven-war-plugin configuration:


plugin
artifactIdmaven-war-plugin/artifactId
configuration
filteringtrue/filtering
filters
filter../../pom.dev.properties/ 
filter

/filters

webResources
resource
directorysrc/main/webapp/ 
directory

filteringtrue/filtering
includes
include**/*/include
/includes
/resource
/webResources

/configuration
/plugin

But, when I package the war, the file has not been filtered. Any  
idea about what is happening?


Thanks.

--
Computer science is not about computers any more than astronomy is  
about telescopes. E.W. Dijkstra (1930-2002)




filtering resources

2009-08-31 Thread Manuel Grau
I've generated a *maven-j2ee-simple application*. I'm deploying to OC4J
10.1.3, so, I've created in the ear module two files:
*
ear/src/main/application/META-INF/data-sources.xml
ear/src/main/application/META-INF/orion-application.xml*

I'm trying to apply filters in this files, but filtering isn't working, only
works with default *ear/src/main/application/META-INF/application.xml*.

   filters

filtersrc/main/application/oc4j.properties/filter

/filters

 resources

  resource

directory*src*/main/application/META-INF/
directory

filteringtrue/filtering

  /resource

/resources
But only application.xml is filtered. So, I tried an alternative, setup
maven-ear-plugin:

  build

finalNamedue-ear/finalName

defaultGoalpackage/defaultGoal



plugins

  plugin

artifactId*maven*-ear-*plugin*/artifactId

configuration

 filteringtrue/filtering

 filters

 filter*src*
/main/application/oc4j.properties/filter

 /filters
The same problem, both files aren't filtered.

-- 
Computer science is not about computers any more than astronomy is about
telescopes. E.W. Dijkstra (1930-2002)


Re: [SOLUTION] Filtering resources in the EAR artifact

2008-10-27 Thread mfs

Was a problem on my end with the usage of the properties..Sorry for the noise

mfs wrote:
 
 I am trying out what you suggested (as i have an exactly similar
 scenario), but still cant get it to work, below is my configuration as in
 my pom.xml..let me know if anything is missed out..
 
   plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-ear-plugin/artifactId
 configuration
  
 earSourceDirectory${basedir}/src/main/resources/earSourceDirectory
   resourcesDir${outputDirectory}/resourcesDir [WE HAVE CUSTOM
 OUTPUT LOCATION AND outputDirectory IN THIS CASE POINTS TO
 ${defaultoutputdirectory}/${project.artifactId}/target/classes folder) 
   version5/version
   defaultLibBundleDirlib/defaultLibBundleDir
   modules
 webModule
   groupIdportal.wes/groupId
   artifactIdwes-webui/artifactId
   bundleDir//bundleDir
 /webModule
 webModule
   groupIdportal.wicket/groupId
   artifactIdwes-wicket/artifactId
   bundleDir//bundleDir
 /webModule
 webModule
   groupIdportal.crystal/groupId
   artifactIdwes-crystal/artifactId
   bundleDir//bundleDir
 /webModule
 ejbModule
   groupIdportal.vcert/groupId
   artifactIdportal-ejb/artifactId
   bundleDirlib/bundleDir
 /ejbModule
   /modules
 /configuration
   /plugin
 /plugins
 resources
   resource
 directorysrc/main/resources/directory
 filteringtrue/filtering
 includes
   include**/META-INF/**/include
 /includes
   /resource
 /resources
   /build
 
 Thanks in advance,
 
 Farhan.
 
 
 
 Vanja Petreski wrote:
 
 Hello,
 
 I lost couple of hours with this problem, so I am giving the solution
 (and
 would like to hear the better one, if there is a such).
 
 The problem:
 
 We have ear with couple of modules (ejb, war...) and META-INF with
 standard
 and proprietary descriptors (data-sources.xml, orion-application.xml,
 etc.).
 Some of them need to be filtered (for example: data-sources.xml).
 
 In order to `mvn package` on the ear artifact generate desired structure,
 we
 have to put our descriptors in the ${basedir}/src/main/application (not
 in
 ${basedir}/src/main/resources).
 
 And that works. But filtering doesn't! If we set filtering on this
 folder,
 in the target we get classes folder with properly filtered resources, but
 the ear is not using them. Ear uses your-ear-artifact in the target to be
 made of. In the target/your-ear-artifact there is META-INF, but with non
 filtered resources.
 
 The quickest (and only one for now, as I know) solution:
 
 We have to tell ear plugin to use ${basedir}/target/classes  as the
 resource
 folder, since there are located properly filtered resources:
 
 plugin
artifactIdmaven-ear-plugin/artifactId
   configuration
  resourcesDirtarget/classes/resourcesDir
   /configuration
 /plugin
 
 Ofcourse, we are using now the standard ${basedir}/src/main/resources
 folder
 with filtering turned on.
 
 Regards,
 Vanja
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-SOLUTION--Filtering-resources-in-the-EAR-artifact-tp13131334p20192445.html
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: [SOLUTION] Filtering resources in the EAR artifact

2008-10-23 Thread mfs

I am trying out what you suggested (as i have an exactly similar scenario),
but still cant get it to work, below is my configuration as in my
pom.xml..let me know if anything is missed out..

  plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-ear-plugin/artifactId
configuration
 
earSourceDirectory${basedir}/src/main/resources/earSourceDirectory
  resourcesDir${outputDirectory}/resourcesDir [WE HAVE CUSTOM
OUTPUT LOCATION AND outputDirectory IN THIS CASE POINTS TO
${defaultoutputdirectory}/${project.artifactId}/target/classes folder) 
  version5/version
  defaultLibBundleDirlib/defaultLibBundleDir
  modules
webModule
  groupIdportal.wes/groupId
  artifactIdwes-webui/artifactId
  bundleDir//bundleDir
/webModule
webModule
  groupIdportal.wicket/groupId
  artifactIdwes-wicket/artifactId
  bundleDir//bundleDir
/webModule
webModule
  groupIdportal.crystal/groupId
  artifactIdwes-crystal/artifactId
  bundleDir//bundleDir
/webModule
ejbModule
  groupIdportal.vcert/groupId
  artifactIdportal-ejb/artifactId
  bundleDirlib/bundleDir
/ejbModule
  /modules
/configuration
  /plugin
/plugins
resources
  resource
directorysrc/main/resources/directory
filteringtrue/filtering
includes
  include**/META-INF/**/include
/includes
  /resource
/resources
  /build

Thanks in advance,

Farhan.



Vanja Petreski wrote:
 
 Hello,
 
 I lost couple of hours with this problem, so I am giving the solution (and
 would like to hear the better one, if there is a such).
 
 The problem:
 
 We have ear with couple of modules (ejb, war...) and META-INF with
 standard
 and proprietary descriptors (data-sources.xml, orion-application.xml,
 etc.).
 Some of them need to be filtered (for example: data-sources.xml).
 
 In order to `mvn package` on the ear artifact generate desired structure,
 we
 have to put our descriptors in the ${basedir}/src/main/application (not in
 ${basedir}/src/main/resources).
 
 And that works. But filtering doesn't! If we set filtering on this folder,
 in the target we get classes folder with properly filtered resources, but
 the ear is not using them. Ear uses your-ear-artifact in the target to be
 made of. In the target/your-ear-artifact there is META-INF, but with non
 filtered resources.
 
 The quickest (and only one for now, as I know) solution:
 
 We have to tell ear plugin to use ${basedir}/target/classes  as the
 resource
 folder, since there are located properly filtered resources:
 
 plugin
artifactIdmaven-ear-plugin/artifactId
   configuration
  resourcesDirtarget/classes/resourcesDir
   /configuration
 /plugin
 
 Ofcourse, we are using now the standard ${basedir}/src/main/resources
 folder
 with filtering turned on.
 
 Regards,
 Vanja
 
 

-- 
View this message in context: 
http://www.nabble.com/-SOLUTION--Filtering-resources-in-the-EAR-artifact-tp13131334p20143151.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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



maven-war-plugin (filtering resources)

2008-09-11 Thread walterw

Hi all,

I am having problems filtering my resources (.jsp, .xml, .sql).  I configure
the context path as well as URLs and so I would like to keep these as
variables so I can update the property in a single place and everything will
be updated automatically.

The issue that I am having is that wherever I use certain attributes:

[code]
${users.id}
${user.id}
${adfadfadflkadf.id}
[/code]

They all match the same pattern unfortunately resulting in an incorrect
override.  I do not want these variables in my JSPs to be matched, but I
want ${context.path} to be matched and it is being matched correctly.  Is
there any way to restrict pattern matching to strict, or is this a bug with
the plexus matching code base?


Please let me know if there is another viable option to filter these
resources.  The maven-war-plugin basically extends the maven-filtering
plugin and are both based off of the plexus pattern matching plugin and that
appears to be causing the problems.

Is it possible to change the pattern matching format as well to only allow
@variable.property@ and not ${variable.property}?  This way, my JSPs can
still use ${} without being adversely affected.


Thanks,
Walter
-- 
View this message in context: 
http://www.nabble.com/maven-war-plugin-%28filtering-resources%29-tp19434177p19434177.html
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: maven-war-plugin (filtering resources)

2008-09-11 Thread Olivier Lamy
Hi,
Currently no way to limit this.
But you can certainly add an issue in
http://jira.codehaus.org/browse/MSHARED under the component
maven-filtering.
As we have fixed http://jira.codehaus.org/browse/MRESOURCES-29 we can
imagine having the same feature with the war plugin.

--
Olivier

2008/9/11 walterw [EMAIL PROTECTED]:

 Hi all,

 I am having problems filtering my resources (.jsp, .xml, .sql).  I configure
 the context path as well as URLs and so I would like to keep these as
 variables so I can update the property in a single place and everything will
 be updated automatically.

 The issue that I am having is that wherever I use certain attributes:

 [code]
 ${users.id}
 ${user.id}
 ${adfadfadflkadf.id}
 [/code]

 They all match the same pattern unfortunately resulting in an incorrect
 override.  I do not want these variables in my JSPs to be matched, but I
 want ${context.path} to be matched and it is being matched correctly.  Is
 there any way to restrict pattern matching to strict, or is this a bug with
 the plexus matching code base?


 Please let me know if there is another viable option to filter these
 resources.  The maven-war-plugin basically extends the maven-filtering
 plugin and are both based off of the plexus pattern matching plugin and that
 appears to be causing the problems.

 Is it possible to change the pattern matching format as well to only allow
 @variable.property@ and not ${variable.property}?  This way, my JSPs can
 still use ${} without being adversely affected.


 Thanks,
 Walter
 --
 View this message in context: 
 http://www.nabble.com/maven-war-plugin-%28filtering-resources%29-tp19434177p19434177.html
 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: maven-war-plugin (filtering resources)

2008-09-11 Thread walterw

Hi,

Thanks for your quick response.

That looks like exactly what I need.  I have tried using the resources
plugin to configure my JSPs but it does not appear to actually update them. 
If the maven-war-plugin is updated, then I think I'd be good to go.


Thanks,
Walter
-- 
View this message in context: 
http://www.nabble.com/maven-war-plugin-%28filtering-resources%29-tp19434177p19435216.html
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 - 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]



filtering resources - switching whole files

2008-04-09 Thread Jan Zelenka
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
 

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
 ---



Filtering Resources : Maven Properties for username builddate

2007-11-13 Thread zm

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?


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]



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]



[SOLUTION] Filtering resources in the EAR artifact

2007-10-10 Thread Vanja Petreski
Hello,

I lost couple of hours with this problem, so I am giving the solution (and
would like to hear the better one, if there is a such).

The problem:

We have ear with couple of modules (ejb, war...) and META-INF with standard
and proprietary descriptors (data-sources.xml, orion-application.xml, etc.).
Some of them need to be filtered (for example: data-sources.xml).

In order to `mvn package` on the ear artifact generate desired structure, we
have to put our descriptors in the ${basedir}/src/main/application (not in
${basedir}/src/main/resources).

And that works. But filtering doesn't! If we set filtering on this folder,
in the target we get classes folder with properly filtered resources, but
the ear is not using them. Ear uses your-ear-artifact in the target to be
made of. In the target/your-ear-artifact there is META-INF, but with non
filtered resources.

The quickest (and only one for now, as I know) solution:

We have to tell ear plugin to use ${basedir}/target/classes  as the resource
folder, since there are located properly filtered resources:

plugin
   artifactIdmaven-ear-plugin/artifactId
  configuration
 resourcesDirtarget/classes/resourcesDir
  /configuration
/plugin

Ofcourse, we are using now the standard ${basedir}/src/main/resources folder
with filtering turned on.

Regards,
Vanja


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]



Filtering resources in Assembly plugin

2007-09-21 Thread Dave Feltenberger
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]



filtering resources in maven-war-plugin

2007-06-11 Thread David Birch

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]


filtering resources in maven-war-plugin - further info

2007-06-11 Thread David Birch

I should note that all resources from the main/resources dir are filtered
correctly, even when just a war:exploded is run, it is just the main/webapp
files that nerver get filtered when only running a war:exploded goal.

cheers
david


Specifying inclusions/exclusions from filtering resources

2007-06-04 Thread Kevin Stembridge
Hi all,
Is there a way to specify that only some files within a given directory 
hierarchy get filtered when resources are copied?
And what about specifically including or excluding certain properties from 
being filtered?

Cheers,
Kevin


---

This e-mail may contain confidential and/or privileged information. If you 
are not the intended recipient (or have received this e-mail in error) 
please notify the sender immediately and destroy this e-mail. Any 
unauthorized copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.

Re: Specifying inclusions/exclusions from filtering resources

2007-06-04 Thread Jo Vandermeeren

Hi Kevin,

You can define separate sets for resources that need to be filtered.
More on includes/excludes here:
http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html


Example..

   resources
   resource
   directorysrc/main/resources/directory
   excludes
   exclude WeOnlyWantToFilterThis.properties/exclude
   /excludes
   /resource
   resource
directorysrc/main/resources/directory
   includes
   includeWeOnlyWantToFilterThis.properties/include
/includes
   filteringtrue/filtering
   /resource
   /resources

Resource filtering is nothing more than applying a parameter map to a
velocity template.
So if you want to prevent a specific value inside the resource from being
filtered, use velocity escaping..

Cheers
Jo

On 6/4/07, Kevin Stembridge [EMAIL PROTECTED] wrote:


Hi all,
Is there a way to specify that only some files within a given directory
hierarchy get filtered when resources are copied?
And what about specifically including or excluding certain properties from
being filtered?

Cheers,
Kevin


---

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.


Re: Specifying inclusions/exclusions from filtering resources

2007-06-04 Thread Kevin Stembridge
Hi Jo,
Thanks for the advice. Works perfectly for me.

Cheers,
Kevin





Jo Vandermeeren [EMAIL PROTECTED] 
04/06/2007 16:30
Please respond to
Maven Users List users@maven.apache.org


To
Maven Users List users@maven.apache.org
cc

Subject
Re: Specifying inclusions/exclusions from filtering resources






Hi Kevin,

You can define separate sets for resources that need to be filtered.
More on includes/excludes here:
http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html



Example..

resources
resource
directorysrc/main/resources/directory
excludes
exclude WeOnlyWantToFilterThis.properties/exclude
/excludes
/resource
resource
 directorysrc/main/resources/directory
includes
includeWeOnlyWantToFilterThis.properties/include
 /includes
filteringtrue/filtering
/resource
/resources

Resource filtering is nothing more than applying a parameter map to a
velocity template.
So if you want to prevent a specific value inside the resource from being
filtered, use velocity escaping..

Cheers
Jo

On 6/4/07, Kevin Stembridge [EMAIL PROTECTED] wrote:

 Hi all,
 Is there a way to specify that only some files within a given directory
 hierarchy get filtered when resources are copied?
 And what about specifically including or excluding certain properties 
from
 being filtered?

 Cheers,
 Kevin


 ---

 This e-mail may contain confidential and/or privileged information. If 
you
 are not the intended recipient (or have received this e-mail in error)
 please notify the sender immediately and destroy this e-mail. Any
 unauthorized copying, disclosure or distribution of the material in this
 e-mail is strictly forbidden.



---

This e-mail may contain confidential and/or privileged information. If you 
are not the intended recipient (or have received this e-mail in error) 
please notify the sender immediately and destroy this e-mail. Any 
unauthorized copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.

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]



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

2007-04-27 Thread Jared Blitzstein
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?


-
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]



Profiles, filtering resources and optional content

2007-03-14 Thread Piotr Bzdyl

Hello everyone,

I would like to have one configuration file in properties format.
Configuration differs in some parts between prod and dev profiles. For
example:

conf.properties for prod env:
keyA=valueAP
keyB=valueBP
keyC=valueCP

conf.properties for dev env:
keyA=valueAD
keyB=valueBD
keyC=valueCD
keyD=valueDD
keyE=valueED

I would change it with use of profiles and filtering to one conf.properties
file like this:
conf.properties:
keyA=${keyAvalueA}
keyB=${keyAvalueB}
keyC=${keyAvalueC}

filter.properties for prod would look like this:
keyAvalue=valueAP
keyBvalue=valueBP
keyCvalue=valueCP

But what to do with values which must be in dev version and must not be in
prod version (keyD and keyE)?

Add in conf.properties something like ${dev.settings} in the end of file and
in filter.properties for dev with:
dev.settings=...

where . is encoded:
keyD=valueDD
keyE=valueED
as a value of dev.settings property?

Any cleaner and more readable solution?

Thanks and regards,
Piotr

-- 
View this message in context: 
http://www.nabble.com/Profiles%2C-filtering-resources-and-optional-content-tf3402841s177.html#a9476847
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: Profiles, filtering resources and optional content

2007-03-14 Thread Piotr Bzdyl

Hi,


Mark Hobson wrote:
 
 An alternative to filtering the same resource is to split it into two
 and profile it.  So you'd move src/main/resources/conf.properties to,
 say:
 
 * src/main/profiles/prod/resources/conf.properties
 * src/main/profiles/dev/resources/conf.properties
 

Actually, I thought about this solution but unfortunately the common part of
the conf.properties is so big that I would not like to keep it in two
separate places and need to remember to change these common parts in two (or
even more if I will need more profiles) files.

Thanks and regards,
Piotr

-- 
View this message in context: 
http://www.nabble.com/Profiles%2C-filtering-resources-and-optional-content-tf3402841s177.html#a9477378
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: Profiles, filtering resources and optional content

2007-03-14 Thread Mark Hobson

An alternative to filtering the same resource is to split it into two
and profile it.  So you'd move src/main/resources/conf.properties to,
say:

* src/main/profiles/prod/resources/conf.properties
* src/main/profiles/dev/resources/conf.properties

Configure the profiles in your POM accordingly, and then you've got
full control of the content of the file under each profile.

Mark

On 14/03/07, Piotr Bzdyl [EMAIL PROTECTED] wrote:


Hello everyone,

I would like to have one configuration file in properties format.
Configuration differs in some parts between prod and dev profiles. For
example:

conf.properties for prod env:
keyA=valueAP
keyB=valueBP
keyC=valueCP

conf.properties for dev env:
keyA=valueAD
keyB=valueBD
keyC=valueCD
keyD=valueDD
keyE=valueED

I would change it with use of profiles and filtering to one conf.properties
file like this:
conf.properties:
keyA=${keyAvalueA}
keyB=${keyAvalueB}
keyC=${keyAvalueC}

filter.properties for prod would look like this:
keyAvalue=valueAP
keyBvalue=valueBP
keyCvalue=valueCP

But what to do with values which must be in dev version and must not be in
prod version (keyD and keyE)?

Add in conf.properties something like ${dev.settings} in the end of file and
in filter.properties for dev with:
dev.settings=...

where . is encoded:
keyD=valueDD
keyE=valueED
as a value of dev.settings property?

Any cleaner and more readable solution?

Thanks and regards,
Piotr

--
View this message in context: 
http://www.nabble.com/Profiles%2C-filtering-resources-and-optional-content-tf3402841s177.html#a9476847
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: Profiles, filtering resources and optional content

2007-03-14 Thread Mark Hobson

On 14/03/07, Piotr Bzdyl [EMAIL PROTECTED] wrote:

Actually, I thought about this solution but unfortunately the common part of
the conf.properties is so big that I would not like to keep it in two
separate places and need to remember to change these common parts in two (or
even more if I will need more profiles) files.


Yeah, that is the drawback.  I guess the general rule of thumb is: if
resources differ between profiles greatly, then profile them;
otherwise filter them.  So in your case I'd create filters that expand
to multiple properties like you suggested.  Although I'd be interested
in any alternatives others may have..?

Mark

-
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 :

Filtering resources

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

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]



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: [m2] Filtering resources

2007-02-28 Thread John J. Franey


Thierry Lach-2 wrote:
 
 Actually settings properties not being available in filtering might cause
 us
 some problems in converting to M2.
 

Properties in settings file are available in resource filtering using a
profile.

Each user should create a profile in their own settings.xml.  Their profile
defines user specific values for the property tokens (e.g., ${db.host} )
that are used in src/test/resources/build.properties.

A settings.xml sample:

settings
  profiles
profile
   idmyProfile/id
   properties
 db.hostlocalhost/db.host
 db.usernameme/db.username
 db.passwordmypassword/db.password
  /properties
   /profile
  /profiles
/settings

Then:  mvn -PmyProfile compile

The tokens: ${db.host}, ${db.username}, ${db.password} appearing in
build.properties will be replaced by the values above.

Each developer is required to define private values for these properties. 
However, the pom.xml can define default values for these properties and they
will be overridden by values in settings.xml.

For more details, see:
http://maven.apache.org/guides/introduction/introduction-to-profiles.html

Regards,
John


-- 
View this message in context: 
http://www.nabble.com/Filtering-resources-tf3307730s177.html#a9225896
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: [m2] Filtering resources

2007-02-28 Thread Thierry Lach

Thanks for the clarification.  That will work well enough.

On 2/28/07, John J. Franey [EMAIL PROTECTED] wrote:




Thierry Lach-2 wrote:

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


Properties in settings file are available in resource filtering using a
profile.

Each user should create a profile in their own settings.xml.  Their
profile
defines user specific values for the property tokens (e.g., ${db.host} )
that are used in src/test/resources/build.properties.

A settings.xml sample:

settings
  profiles
profile
   idmyProfile/id
   properties
 db.hostlocalhost/db.host
 db.usernameme/db.username
 db.passwordmypassword/db.password
  /properties
   /profile
  /profiles
/settings

Then:  mvn -PmyProfile compile

The tokens: ${db.host}, ${db.username}, ${db.password} appearing in
build.properties will be replaced by the values above.

Each developer is required to define private values for these properties.
However, the pom.xml can define default values for these properties and
they
will be overridden by values in settings.xml.

For more details, see:
http://maven.apache.org/guides/introduction/introduction-to-profiles.html

Regards,
John


--
View this message in context:
http://www.nabble.com/Filtering-resources-tf3307730s177.html#a9225896
Sent from the Maven - Users mailing list archive at Nabble.com.


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




[m2] (Filtering Resources) adding timestamp to a property file during releasing

2006-11-23 Thread SoftwareEngineering Hauschel

Hi all,
any idea how to add a non static property to a property file while build
time?

Thanks Fredy


Filtering resources and timestamp?

2006-05-15 Thread David Hay
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]



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]



[m2] Filtering resources problem

2006-05-12 Thread Marcell Manfrin Barbacena

Hi,

I'm following the started guide and when I try to replace ${pom.name}
for ${settings.localRepository} when filtering a resource I got the
string ${settings.localRepository} back. My settings.xml is placed in
~/.m2/settings.xml and working fine cause I can deploy using
configurations there. Am I doing something wrong?

One other question: is it possible to define properties in the
settings.xml as we can do in the pom?

[]s

ps: my settings.xml

settings
offlinefalse/offline
servers
  server
idlsd/id
usernamemarcell/username
passphrase/
  /server
/servers
/settings

pss: I thought 1st it was because the localRepository is not
specified, but then i changed for ${settings.offline} and got nothing
again :-(

--
Nobody knows who i really am
I never felt this empty before
And if I never need someone to come along
Who's gonna comfort me and keep me strong?
--
Marcell Manfrin Barbacena
[EMAIL PROTECTED]
MSN Messenger: [EMAIL PROTECTED]
ICQ UIN: 63671762
Skype: callto://marcell84bruk
+55 (83) 8808-8555 (Oi)

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



Filtering resources during assembly

2006-02-02 Thread brian . a . yoffe
I have a POM that creates an assembly (by using the mvn assembly:assembly 
command). Before assembling my directories, I want filtering to occur 
on some set of resources.

I can achieve this if I execute:
mvn resources:resources assembly:assembly

Is there a way to get the resource filtering to occur automatically as 
part of the assembly step so that I can simply execute:
mvn assembly:assembly

My POM is attached below:

Thanks,
Brian Yoffe


--

project xmlns=http://maven.apache.org/POM/4.0.0; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;
  parent
groupIdcom.jpmorgan.pat.fi/groupId
artifactIdfixed-income/artifactId
version1.0-SNAPSHOT/version
  /parent
  modelVersion4.0.0/modelVersion
  artifactIdconfiguration/artifactId
  packagingpom/packaging
  namePat Fixed Income Packaging/name
  urlhttp://maven.apache.org/url
  dependencies
dependency
  groupId${pom.groupId}/groupId
  artifactIdfi-strategies/artifactId
  version${pom.version}/version
  scoperuntime/scope
/dependency
  /dependencies
  build
resources
  resource
directorysrc/main/conf/common/directory
filteringtrue/filtering
  /resource
  resource
directorysrc/main/conf/${env}/directory
filteringtrue/filtering
  /resource
/resources
filters
  filtersrc/main/conf/${env}/filter_default.properties/filter
/filters
plugins
   plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-assembly-plugin/artifactId
configuration
  finalName${project.build.finalName}-sit/finalName
  descriptors
 descriptorsrc/main/assembly/conf.xml/descriptor
 descriptorsrc/main/assembly/bin.xml/descriptor
  /descriptors
/configuration
/plugin
/plugins
  /build
/project

This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market prices,
data and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein 
do not necessarily reflect those of JPMorgan Chase  Co., its subsidiaries 
and affiliates.

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]



filtering resources resources

2006-01-17 Thread Tom Joad
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]



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]



Filtering resources

2006-01-11 Thread Karthik V
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-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?


Re: [m2] Filtering resources and current time

2005-12-14 Thread Edwin Punzalan


AFAIK, there is no ${} expression with the current time as value.  You 
may want to file a jira request for this feature though.  The Maven 2 
jira is here: http://jira.codehaus.org/browse/MNG



Piotr Bzdyl wrote:


Hello,

I would like to have something like this in my pom.xml

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

and in src/main/resources/app.properties:
app.buildTime=${currentTime}

to get current time (the time when I call mvn package for example) in 
the place of ${currentTime}. Is there a maven built-in property 
holding current time?


Best regards,
Piotrek

-
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: [m2] Filtering resources and current time

2005-12-14 Thread Wim Deblauwe
I could use that too, so please file an issue.

2005/12/15, Edwin Punzalan [EMAIL PROTECTED]:


 AFAIK, there is no ${} expression with the current time as value.  You
 may want to file a jira request for this feature though.  The Maven 2
 jira is here: http://jira.codehaus.org/browse/MNG


 Piotr Bzdyl wrote:

  Hello,
 
  I would like to have something like this in my pom.xml
 
  build
   resources
 resource
   directorysrc/main/resources/directory
   filteringtrue/filtering
 /resource
   /resources
  /build
 
  and in src/main/resources/app.properties:
  app.buildTime=${currentTime}
 
  to get current time (the time when I call mvn package for example) in
  the place of ${currentTime}. Is there a maven built-in property
  holding current time?
 
  Best regards,
  Piotrek
 
  -
  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: [m2] Filtering resources and current time

2005-12-14 Thread Allan Ramirez

I think this is already filed..
See MNG-1832

-allan

Wim Deblauwe wrote:


I could use that too, so please file an issue.

2005/12/15, Edwin Punzalan [EMAIL PROTECTED]:
 


AFAIK, there is no ${} expression with the current time as value.  You
may want to file a jira request for this feature though.  The Maven 2
jira is here: http://jira.codehaus.org/browse/MNG


Piotr Bzdyl wrote:

   


Hello,

I would like to have something like this in my pom.xml

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

and in src/main/resources/app.properties:
app.buildTime=${currentTime}

to get current time (the time when I call mvn package for example) in
the place of ${currentTime}. Is there a maven built-in property
holding current time?

Best regards,
Piotrek

-
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]


   



 




No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/200 - Release Date: 12/14/2005

 



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

[m2] Filtering resources and current time

2005-12-12 Thread Piotr Bzdyl

Hello,

I would like to have something like this in my pom.xml

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

and in src/main/resources/app.properties:
app.buildTime=${currentTime}

to get current time (the time when I call mvn package for example) in 
the place of ${currentTime}. Is there a maven built-in property holding 
current time?


Best regards,
Piotrek

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



ClassCastException on filtering resources

2005-11-15 Thread Jean-Sebastien Bournival
 
Hi, I'm trying to use filtering in my pom.

  build
finalNametembec/finalName
filters
  filtersrc/main/filters/filter.properties/filter
/filters  
resources
  resource
directorysrc\main\webapp-filtered/directory
filteringtrue/filtering
  /resource
/resources
  /build

But when I try to use the ${basedir} property in any of my
src\main\webapp-filtered files, I have this exception:

[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO]

[ERROR] FATAL ERROR
[INFO]

[INFO] java.io.File
[INFO]

[INFO] Trace
java.lang.ClassCastException: java.io.File
at
org.codehaus.plexus.util.InterpolationFilterReader.read(InterpolationFilterR
eader.java:269)
at
org.codehaus.plexus.util.InterpolationFilterReader.read(InterpolationFilterR
eader.java:162)
at java.io.Reader.read(Reader.java:122)
at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:212)
at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:200)
at
org.apache.maven.plugin.resources.ResourcesMojo.copyFile(ResourcesMojo.java:
240)
at
org.apache.maven.plugin.resources.ResourcesMojo.copyResources(ResourcesMojo.
java:172)
at
org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo.java:1
00)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage
r.java:399)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife
cycleExecutor.java:519)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(De
faultLifecycleExecutor.java:482)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifec
ycleExecutor.java:452)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail
ures(DefaultLifecycleExecutor.java:301)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa
ultLifecycleExecutor.java:268)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle
Executor.java:137)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:316)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:113)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

Really weird ... Is there something I'm doing wrong?

Jean-Sébastien Bournival

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



RE: ClassCastException on filtering resources

2005-11-15 Thread Jean-Sebastien Bournival
I forgot to say I am using Maven 2, JDK 1.4.2_09.

-Message d'origine-
De : Jean-Sebastien Bournival [mailto:[EMAIL PROTECTED] 
Envoyé : 15 novembre 2005 11:36
À : users@maven.apache.org
Objet : ClassCastException on filtering resources

 
Hi, I'm trying to use filtering in my pom.

  build
finalNametembec/finalName
filters
  filtersrc/main/filters/filter.properties/filter
/filters  
resources
  resource
directorysrc\main\webapp-filtered/directory
filteringtrue/filtering
  /resource
/resources
  /build

But when I try to use the ${basedir} property in any of my
src\main\webapp-filtered files, I have this exception:

[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO]

[ERROR] FATAL ERROR
[INFO]

[INFO] java.io.File
[INFO]

[INFO] Trace
java.lang.ClassCastException: java.io.File
at
org.codehaus.plexus.util.InterpolationFilterReader.read(InterpolationFilterR
eader.java:269)
at
org.codehaus.plexus.util.InterpolationFilterReader.read(InterpolationFilterR
eader.java:162)
at java.io.Reader.read(Reader.java:122)
at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:212)
at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:200)
at
org.apache.maven.plugin.resources.ResourcesMojo.copyFile(ResourcesMojo.java:
240)
at
org.apache.maven.plugin.resources.ResourcesMojo.copyResources(ResourcesMojo.
java:172)
at
org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo.java:1
00)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage
r.java:399)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife
cycleExecutor.java:519)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(De
faultLifecycleExecutor.java:482)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifec
ycleExecutor.java:452)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail
ures(DefaultLifecycleExecutor.java:301)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa
ultLifecycleExecutor.java:268)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle
Executor.java:137)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:316)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:113)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

Really weird ... Is there something I'm doing wrong?

Jean-Sébastien Bournival

-
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: ClassCastException on filtering resources

2005-11-15 Thread Brett Porter
This sounds like a particular bug with basedir. Please file it in JIRA.

- Brett

On 11/16/05, Jean-Sebastien Bournival
[EMAIL PROTECTED] wrote:
 I forgot to say I am using Maven 2, JDK 1.4.2_09.

 -Message d'origine-
 De : Jean-Sebastien Bournival [mailto:[EMAIL PROTECTED]
 Envoyé : 15 novembre 2005 11:36
 À : users@maven.apache.org
 Objet : ClassCastException on filtering resources


 Hi, I'm trying to use filtering in my pom.

   build
 finalNametembec/finalName
 filters
   filtersrc/main/filters/filter.properties/filter
 /filters
 resources
   resource
 directorysrc\main\webapp-filtered/directory
 filteringtrue/filtering
   /resource
 /resources
   /build

 But when I try to use the ${basedir} property in any of my
 src\main\webapp-filtered files, I have this exception:

 [INFO] [resources:resources]
 [INFO] Using default encoding to copy filtered resources.
 [INFO]
 
 [ERROR] FATAL ERROR
 [INFO]
 
 [INFO] java.io.File
 [INFO]
 
 [INFO] Trace
 java.lang.ClassCastException: java.io.File
 at
 org.codehaus.plexus.util.InterpolationFilterReader.read(InterpolationFilterR
 eader.java:269)
 at
 org.codehaus.plexus.util.InterpolationFilterReader.read(InterpolationFilterR
 eader.java:162)
 at java.io.Reader.read(Reader.java:122)
 at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:212)
 at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:200)
 at
 org.apache.maven.plugin.resources.ResourcesMojo.copyFile(ResourcesMojo.java:
 240)
 at
 org.apache.maven.plugin.resources.ResourcesMojo.copyResources(ResourcesMojo.
 java:172)
 at
 org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo.java:1
 00)
 at
 org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage
 r.java:399)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife
 cycleExecutor.java:519)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(De
 faultLifecycleExecutor.java:482)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifec
 ycleExecutor.java:452)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail
 ures(DefaultLifecycleExecutor.java:301)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa
 ultLifecycleExecutor.java:268)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle
 Executor.java:137)
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:316)
 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:113)
 at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
 )
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
 .java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at
 org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
 at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
 at
 org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
 at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

 Really weird ... Is there something I'm doing wrong?

 Jean-Sébastien Bournival

 -
 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: [M2] How does filtering resources work?

2005-08-23 Thread Ralph Pöllath

On 23.08.2005, at 07:53, Carsten Ziegeler wrote:
If I'm not the only one who thinks that filters directly defined at  
the

resources is a good idea, I could try to develop a patch. Interested?


+1

Cheers,
-Ralph.


Carsten

Carsten Ziegeler wrote:


Hi Brett,

Brett Porter wrote:


There was some hesitation to adding filtering in the first place  
- we

added it as a parameter on the resources plugin because it was
uncertain it would be retained in the POM. It now looks like it  
will,

but we're wary of how it is used.

It is important for Maven to work that the values filtered in are
always the same if the artifact being built is the same. If you want
to build 2 different artifacts, you use 2 profiles (or two  
projects),

and provide different filters to each.



Ok, agree.



I'm curious why you need different filters for different sets of  
files

- do they have changing values or is it just an optimisation?



Kind of optimization and I don't want to filter binary files. So I
thought of creating one resource set with ascii files and one for
the binary files and apply filtering only to the first set to be sure
that the binary files don't get corrupted.




Also, it should be noted that Maven builds in a pom.properties file
into META-INF as well as a copy of pom.xml so that you can retrieve
such values at runtime if needed.

Anyway, I'm happy to discuss what the filtering needs are and adjust
accordingly. I'm still reluctant to promote filters to the resource
element itself, but it can be considered again.



I think it makes more sense to have it at the resources element  
because

you define your resource sets and then you want to apply directly to
this set some filtering (or not). If you separate this (resource  
set and
plugin configuration) it's not that obvious what's really going on  
and
it makes it imho harder to apply filtering than it should be. You  
loose
the connection between the resource sets (or test resource sets)  
and the

settings of the plugin.

WDYT?

Carsten


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



Re: [M2] How does filtering resources work?

2005-08-23 Thread Brett Porter
I thinhk we should bounce this off the maven developer list first, but
I'm thinking it is reasonable.

- Brett

On 8/23/05, Carsten Ziegeler [EMAIL PROTECTED] wrote:
 If I'm not the only one who thinks that filters directly defined at the
 resources is a good idea, I could try to develop a patch. Interested?
 
 Carsten
 
 Carsten Ziegeler wrote:
  Hi Brett,
 
  Brett Porter wrote:
 
 There was some hesitation to adding filtering in the first place - we
 added it as a parameter on the resources plugin because it was
 uncertain it would be retained in the POM. It now looks like it will,
 but we're wary of how it is used.
 
 It is important for Maven to work that the values filtered in are
 always the same if the artifact being built is the same. If you want
 to build 2 different artifacts, you use 2 profiles (or two projects),
 and provide different filters to each.
 
  Ok, agree.
 
 
 I'm curious why you need different filters for different sets of files
 - do they have changing values or is it just an optimisation?
 
  Kind of optimization and I don't want to filter binary files. So I
  thought of creating one resource set with ascii files and one for
  the binary files and apply filtering only to the first set to be sure
  that the binary files don't get corrupted.
 
 
 Also, it should be noted that Maven builds in a pom.properties file
 into META-INF as well as a copy of pom.xml so that you can retrieve
 such values at runtime if needed.
 
 Anyway, I'm happy to discuss what the filtering needs are and adjust
 accordingly. I'm still reluctant to promote filters to the resource
 element itself, but it can be considered again.
 
  I think it makes more sense to have it at the resources element because
  you define your resource sets and then you want to apply directly to
  this set some filtering (or not). If you separate this (resource set and
  plugin configuration) it's not that obvious what's really going on and
  it makes it imho harder to apply filtering than it should be. You loose
  the connection between the resource sets (or test resource sets) and the
  settings of the plugin.
 
  WDYT?
 
  Carsten
 
 
 --
 Carsten Ziegeler - Open Source Group, SN AG
 http://www.s-und-n.de
 http://www.osoco.org/weblogs/rael/
 
 -
 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: [M2] How does filtering resources work?

2005-08-22 Thread Carsten Ziegeler
If I'm not the only one who thinks that filters directly defined at the
resources is a good idea, I could try to develop a patch. Interested?

Carsten

Carsten Ziegeler wrote:
 Hi Brett,
 
 Brett Porter wrote:
 
There was some hesitation to adding filtering in the first place - we
added it as a parameter on the resources plugin because it was
uncertain it would be retained in the POM. It now looks like it will,
but we're wary of how it is used.

It is important for Maven to work that the values filtered in are
always the same if the artifact being built is the same. If you want
to build 2 different artifacts, you use 2 profiles (or two projects),
and provide different filters to each.
 
 Ok, agree.
 
 
I'm curious why you need different filters for different sets of files
- do they have changing values or is it just an optimisation?
 
 Kind of optimization and I don't want to filter binary files. So I
 thought of creating one resource set with ascii files and one for
 the binary files and apply filtering only to the first set to be sure
 that the binary files don't get corrupted.
 
 
Also, it should be noted that Maven builds in a pom.properties file
into META-INF as well as a copy of pom.xml so that you can retrieve
such values at runtime if needed.

Anyway, I'm happy to discuss what the filtering needs are and adjust
accordingly. I'm still reluctant to promote filters to the resource
element itself, but it can be considered again.
 
 I think it makes more sense to have it at the resources element because
 you define your resource sets and then you want to apply directly to
 this set some filtering (or not). If you separate this (resource set and
 plugin configuration) it's not that obvious what's really going on and
 it makes it imho harder to apply filtering than it should be. You loose
 the connection between the resource sets (or test resource sets) and the
 settings of the plugin.
 
 WDYT?
 
 Carsten


-- 
Carsten Ziegeler - Open Source Group, SN AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

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



Re: [M2] How does filtering resources work?

2005-08-20 Thread Carsten Ziegeler
Andrius Karpavicius schrieb:
 Hi,
 
 I am almost an expert here, after trying to get filtering work for two 
 days :)
 
:)

 
 It seems like you can replace trwo things :
 
 1. From a properties file  in a format ${token} or @token@
 2. From a POM.xml file ${project.version} 
 
Ah, great, thanks!

 To apply different filtering to diferent resources you would have to 
 define resoruces as part of maven-resources-plugin configuration,
 
 Unfortunatelly I was not able to do so. It would simply ignore my 
 resources settings. You can see earlier emails.
 
Yes, I saw them - :( So, can someone help us here?

Thanks!
Carsten
-- 
Carsten Ziegeler - Open Source Group, SN AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

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



Re: [M2] How does filtering resources work?

2005-08-20 Thread Carsten Ziegeler
Hi Brett,

Brett Porter wrote:
 There was some hesitation to adding filtering in the first place - we
 added it as a parameter on the resources plugin because it was
 uncertain it would be retained in the POM. It now looks like it will,
 but we're wary of how it is used.
 
 It is important for Maven to work that the values filtered in are
 always the same if the artifact being built is the same. If you want
 to build 2 different artifacts, you use 2 profiles (or two projects),
 and provide different filters to each.
Ok, agree.

 
 I'm curious why you need different filters for different sets of files
 - do they have changing values or is it just an optimisation?
Kind of optimization and I don't want to filter binary files. So I
thought of creating one resource set with ascii files and one for
the binary files and apply filtering only to the first set to be sure
that the binary files don't get corrupted.

 
 Also, it should be noted that Maven builds in a pom.properties file
 into META-INF as well as a copy of pom.xml so that you can retrieve
 such values at runtime if needed.
 
 Anyway, I'm happy to discuss what the filtering needs are and adjust
 accordingly. I'm still reluctant to promote filters to the resource
 element itself, but it can be considered again.
I think it makes more sense to have it at the resources element because
you define your resource sets and then you want to apply directly to
this set some filtering (or not). If you separate this (resource set and
plugin configuration) it's not that obvious what's really going on and
it makes it imho harder to apply filtering than it should be. You loose
the connection between the resource sets (or test resource sets) and the
settings of the plugin.

WDYT?

Carsten
-- 
Carsten Ziegeler - Open Source Group, SN AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

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



[M2] How does filtering resources work?

2005-08-19 Thread Carsten Ziegeler
I'm a little confused how filtering of resources in M2 works.
Now, I can define several resource sets in the build resources
section (with include/exclude) patterns. But there is no way
of defining filters there. (At least that's what I think).

Now I can turn on filtering in the resources plugin. I guess without
any additional configuration, this enables filtering for *all* resources.
So if I only want to filter one resource set (defined in the build
section), do I have to specify the same resources in the plugin
configuration as well? Wouldn't it be better to define the filters
directly at the resources in the build section?

On the same topic, is it possible to have filters that replace tokens
with values from the pom, like project name or version?

Thanks
Carsten
-- 
Carsten Ziegeler - Open Source Group, SN AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

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



Re: [M2] How does filtering resources work?

2005-08-19 Thread Andrius Karpavicius
Hi,

I am almost an expert here, after trying to get filtering work for two 
days :)


From resources plugin code:

// support ${token}
Reader reader = new InterpolationFilterReader( fileReader, 
filterProperties, ${, } );
// support @token@
reader = new InterpolationFilterReader( reader, 
filterProperties, @, @ );
 
reader = new InterpolationFilterReader( reader, new 
ReflectionProperties( project ), ${, } );


It seems like you can replace trwo things :

1. From a properties file  in a format ${token} or @token@
2. From a POM.xml file ${project.version} 

To apply different filtering to diferent resources you would have to 
define resoruces as part of maven-resources-plugin configuration,

Unfortunatelly I was not able to do so. It would simply ignore my 
resources settings. You can see earlier emails.

Can somebory tell what is a proper way of configuring resources in 
plugin/config section, or is it a bug?


 plugin
   groupIdorg.apache.maven.plugins/groupId
   artifactIdmaven-resources-plugin/artifactId
   executions
 execution
   phasecompile/phase
   goals
 goalresources/goal
   /goals
   configuration
 resources
   resource
 targetPath../filtered-webapp-resources/targetPath
 directory${basedir}/src/main/webapp/directory
   /resource
   resource
 targetPath../filtered-webapp-resources/WEB-INF/classes/targetPath
 directory${basedir}/src/main/resources/directory
   /resource
 /resources
 
outputDirectory${project.build.directory}/${project.build.finalName}/copiedwithresources/outputDirectory
 
filterPropertiesFile${basedir}/src/filters/filter.properties/filterPropertiesFile
 filteringtrue/filtering
   /configuration
  /execution
/executions
  /plugin






Carsten Ziegeler [EMAIL PROTECTED] 
2005.08.19 15:20
Please respond to
Maven Users List users@maven.apache.org


To
users@maven.apache.org
cc

Subject
[M2] How does filtering resources work?






I'm a little confused how filtering of resources in M2 works.
Now, I can define several resource sets in the build resources
section (with include/exclude) patterns. But there is no way
of defining filters there. (At least that's what I think).

Now I can turn on filtering in the resources plugin. I guess without
any additional configuration, this enables filtering for *all* resources.
So if I only want to filter one resource set (defined in the build
section), do I have to specify the same resources in the plugin
configuration as well? Wouldn't it be better to define the filters
directly at the resources in the build section?

On the same topic, is it possible to have filters that replace tokens
with values from the pom, like project name or version?

Thanks
Carsten
-- 
Carsten Ziegeler - Open Source Group, SN AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

-
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: [M2] How does filtering resources work?

2005-08-19 Thread Brett Porter
There was some hesitation to adding filtering in the first place - we
added it as a parameter on the resources plugin because it was
uncertain it would be retained in the POM. It now looks like it will,
but we're wary of how it is used.

It is important for Maven to work that the values filtered in are
always the same if the artifact being built is the same. If you want
to build 2 different artifacts, you use 2 profiles (or two projects),
and provide different filters to each.

I'm curious why you need different filters for different sets of files
- do they have changing values or is it just an optimisation?

Also, it should be noted that Maven builds in a pom.properties file
into META-INF as well as a copy of pom.xml so that you can retrieve
such values at runtime if needed.

Anyway, I'm happy to discuss what the filtering needs are and adjust
accordingly. I'm still reluctant to promote filters to the resource
element itself, but it can be considered again.

Cheers,
Brett

On 8/20/05, Andrius Karpavicius [EMAIL PROTECTED] wrote:
 Hi,
 
 I am almost an expert here, after trying to get filtering work for two
 days :)
 
 
 From resources plugin code:
 
 // support ${token}
 Reader reader = new InterpolationFilterReader( fileReader,
 filterProperties, ${, } );
 // support @token@
 reader = new InterpolationFilterReader( reader,
 filterProperties, @, @ );
 
 reader = new InterpolationFilterReader( reader, new
 ReflectionProperties( project ), ${, } );
 
 
 It seems like you can replace trwo things :
 
 1. From a properties file  in a format ${token} or @token@
 2. From a POM.xml file ${project.version}
 
 To apply different filtering to diferent resources you would have to
 define resoruces as part of maven-resources-plugin configuration,
 
 Unfortunatelly I was not able to do so. It would simply ignore my
 resources settings. You can see earlier emails.
 
 Can somebory tell what is a proper way of configuring resources in
 plugin/config section, or is it a bug?
 
 
  plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-resources-plugin/artifactId
executions
  execution
phasecompile/phase
goals
  goalresources/goal
/goals
configuration
  resources
resource
  targetPath../filtered-webapp-resources/targetPath
  directory${basedir}/src/main/webapp/directory
/resource
resource
  targetPath../filtered-webapp-resources/WEB-INF/classes/targetPath
  directory${basedir}/src/main/resources/directory
/resource
  /resources
 
 outputDirectory${project.build.directory}/${project.build.finalName}/copiedwithresources/outputDirectory
 
 filterPropertiesFile${basedir}/src/filters/filter.properties/filterPropertiesFile
  filteringtrue/filtering
/configuration
   /execution
 /executions
   /plugin
 
 
 
 
 
 
 Carsten Ziegeler [EMAIL PROTECTED]
 2005.08.19 15:20
 Please respond to
 Maven Users List users@maven.apache.org
 
 
 To
 users@maven.apache.org
 cc
 
 Subject
 [M2] How does filtering resources work?
 
 
 
 
 
 
 I'm a little confused how filtering of resources in M2 works.
 Now, I can define several resource sets in the build resources
 section (with include/exclude) patterns. But there is no way
 of defining filters there. (At least that's what I think).
 
 Now I can turn on filtering in the resources plugin. I guess without
 any additional configuration, this enables filtering for *all* resources.
 So if I only want to filter one resource set (defined in the build
 section), do I have to specify the same resources in the plugin
 configuration as well? Wouldn't it be better to define the filters
 directly at the resources in the build section?
 
 On the same topic, is it possible to have filters that replace tokens
 with values from the pom, like project name or version?
 
 Thanks
 Carsten
 --
 Carsten Ziegeler - Open Source Group, SN AG
 http://www.s-und-n.de
 http://www.osoco.org/weblogs/rael/
 
 -
 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]



File encoding used when filtering resources - unable to spesify encoding

2004-01-07 Thread kai lilleby
Help!
Has anyone experienced problems with wrong character encoding beeing
used when running java:jar-resources or test:test-resources ? 

It seems like the filtering target that is beeing used here
(maven:copy-resources) uses default encoding returned by the OS, wich is
different on win and Linux - hence causing problems when building the
same CVS-checkout on these two platforms.

Is there a way to specify what file encoding to use when running these
tasks? (looked in maven jelly doc - no suitable opts for the
maven:copy-resource ..)

Have tried setting the -Dfile.encoding property when running maven (i.e.
'$ maven -Dfile.encoding=ISO-8859-1 test') but this doesnt help - it
seems like options provided at tha maven CLI doesnt get propagate to the
JVM in which the targets are run.. (adding System.out.println(
System.getProperty(file.encoding)); to a test verifies this)

Any sugestions??

Kai/Norway :)


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