Quantcast

resource filtering on dependencies

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

resource filtering on dependencies

offbyone
I have a project that creates a generic package which is then used in
several other nearly identical sibling projects.  These projects pull this
"client-generic" package in as a dependency and create an almost identical
package other than the difference in these configuration files.   This
looks like this where the client-generic is the dependency brought into
each of the other final client projects:
client
...client-generic
...client1
...client2
...client3

These clientx projects have some completely different files in them.  I use
the maven assembly plugin to bring these new files in.  However, the
clientx projects also have several configuration files that are identical
other than a property.  For instance, there is one configuration file which
is identical in all of them except for an "IPAddress" property.

Ideally, I would like to avoid duplicating this file in every clientx
project and instead put this configuration file in the client-generic
project with a property set:
            <value>${IPAddress}</value>
Then I would like for each clientx project to set the property accordingly.

I am using the maven-dependency-plugin unpack goal to unpack the
"client-generic" dependency into these other projects.  Is there a way to
apply resource filtering for the unpack goal so I can filter this property
on the configuration file that is in the dependency?

thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: resource filtering on dependencies

Wayne Fay
> I am using the maven-dependency-plugin unpack goal to unpack the
> "client-generic" dependency into these other projects.  Is there a way to
> apply resource filtering for the unpack goal so I can filter this property
> on the configuration file that is in the dependency?

You should find complete directions in this Sonatype blog post written
by Brian Fox:
http://www.sonatype.com/people/2008/04/how-to-share-resources-across-projects-in-maven/

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: resource filtering on dependencies

offbyone
That blog post seemed very self explanatory, but it didn't work.

What I am getting from the blog is that if you bind a plugin to the
"generate-resources" phase, then you can filter on the resulting files in
project build directory.

I did this, but no luck.  The only difference between what I am doing and
what the blog does is that the blog is using "unpack-dependencies" goal
while I am simply using the "unpack" goal.  I assume that shouldn't matter.

When you turn on filtering on a resource directory, does it apply
recursively?

On Tue, Apr 3, 2012 at 2:32 PM, Wayne Fay <[hidden email]> wrote:

> > I am using the maven-dependency-plugin unpack goal to unpack the
> > "client-generic" dependency into these other projects.  Is there a way to
> > apply resource filtering for the unpack goal so I can filter this
> property
> > on the configuration file that is in the dependency?
>
> You should find complete directions in this Sonatype blog post written
> by Brian Fox:
>
> http://www.sonatype.com/people/2008/04/how-to-share-resources-across-projects-in-maven/
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: resource filtering on dependencies

offbyone
I tried the unpack-dependencies but that didn't make a difference, still
doesn't work as described.

On Tue, Apr 3, 2012 at 3:34 PM, Ryan Wexler <[hidden email]> wrote:

> That blog post seemed very self explanatory, but it didn't work.
>
> What I am getting from the blog is that if you bind a plugin to the
> "generate-resources" phase, then you can filter on the resulting files in
> project build directory.
>
> I did this, but no luck.  The only difference between what I am doing and
> what the blog does is that the blog is using "unpack-dependencies" goal
> while I am simply using the "unpack" goal.  I assume that shouldn't matter.
>
> When you turn on filtering on a resource directory, does it apply
> recursively?
>
>
> On Tue, Apr 3, 2012 at 2:32 PM, Wayne Fay <[hidden email]> wrote:
>
>> > I am using the maven-dependency-plugin unpack goal to unpack the
>> > "client-generic" dependency into these other projects.  Is there a way
>> to
>> > apply resource filtering for the unpack goal so I can filter this
>> property
>> > on the configuration file that is in the dependency?
>>
>> You should find complete directions in this Sonatype blog post written
>> by Brian Fox:
>>
>> http://www.sonatype.com/people/2008/04/how-to-share-resources-across-projects-in-maven/
>>
>> Wayne
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: resource filtering on dependencies

offbyone
After further investigation, this method is working, just not at the point
I thought it was.  I am unpacking all the dependencies and resources into a
directory.  That directory is not filtered but it is repackaged as a jar
and the resources are filtered in the jar.  I thought it would apply the
resource filtering to the directory.

On Tue, Apr 3, 2012 at 4:11 PM, Ryan Wexler <[hidden email]> wrote:

> I tried the unpack-dependencies but that didn't make a difference, still
> doesn't work as described.
>
>
> On Tue, Apr 3, 2012 at 3:34 PM, Ryan Wexler <[hidden email]> wrote:
>
>> That blog post seemed very self explanatory, but it didn't work.
>>
>> What I am getting from the blog is that if you bind a plugin to the
>> "generate-resources" phase, then you can filter on the resulting files in
>> project build directory.
>>
>> I did this, but no luck.  The only difference between what I am doing and
>> what the blog does is that the blog is using "unpack-dependencies" goal
>> while I am simply using the "unpack" goal.  I assume that shouldn't matter.
>>
>> When you turn on filtering on a resource directory, does it apply
>> recursively?
>>
>>
>> On Tue, Apr 3, 2012 at 2:32 PM, Wayne Fay <[hidden email]> wrote:
>>
>>> > I am using the maven-dependency-plugin unpack goal to unpack the
>>> > "client-generic" dependency into these other projects.  Is there a way
>>> to
>>> > apply resource filtering for the unpack goal so I can filter this
>>> property
>>> > on the configuration file that is in the dependency?
>>>
>>> You should find complete directions in this Sonatype blog post written
>>> by Brian Fox:
>>>
>>> http://www.sonatype.com/people/2008/04/how-to-share-resources-across-projects-in-maven/
>>>
>>> Wayne
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>
Loading...