You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Brad O'Hearne <br...@neurofire.com> on 2006/03/06 20:37:05 UTC

is there a way to filter dependency jars from being packaged

I am building a JBoss sar and a JBoss wsr using the sar and wsr plugins. 
I would like to create these archives without including all of the jar 
dependencies. After looking at the documentation, I tried putting this 
into my dependency declaration in my pom:

            <optional>true</optional>

This doesn't appear to work the way the documentation states. In my 
project, I have one dependency: call it B. I have declared B to be 
optional in my pom. When I package my project, inside the archive, B has 
been filtered out, but all of B's dependencies are there. Basically what 
I want to have happen, is that I want to filter B and all its 
depedencies up the dependency hierarchy from being inside the archive.

How can this be accomplished?

Thanks.

Brad



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


Re: is there a way to filter dependency jars from being packaged

Posted by Brad O'Hearne <br...@neurofire.com>.
Yeah, that's what I'm doing. But if there isn't an easier way, there 
needs to be. I have a dependency hierarchy 3 levels deep for this 
project, and it is a real pain to crawl the dependency tree to configure 
a pom. You should just be able to designate a depedency jar as being 
excluded, and all of its ancestral dependencies will be excluded as 
well. It makes sense for optimizing ear, sar, and wsr archiving.

Brad


Wayne Fay wrote:

>Perhaps add all of B's dependencies in your pom as excluded?
>
>Wayne
>
>
>On 3/6/06, Brad O'Hearne <br...@neurofire.com> wrote:
>  
>
>>I am building a JBoss sar and a JBoss wsr using the sar and wsr plugins.
>>I would like to create these archives without including all of the jar
>>dependencies. After looking at the documentation, I tried putting this
>>into my dependency declaration in my pom:
>>
>>           <optional>true</optional>
>>
>>This doesn't appear to work the way the documentation states. In my
>>project, I have one dependency: call it B. I have declared B to be
>>optional in my pom. When I package my project, inside the archive, B has
>>been filtered out, but all of B's dependencies are there. Basically what
>>I want to have happen, is that I want to filter B and all its
>>depedencies up the dependency hierarchy from being inside the archive.
>>
>>How can this be accomplished?
>>
>>Thanks.
>>
>>Brad
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>  
>


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


Re: is there a way to filter dependency jars from being packaged

Posted by Wayne Fay <wa...@gmail.com>.
Perhaps add all of B's dependencies in your pom as excluded?

Wayne


On 3/6/06, Brad O'Hearne <br...@neurofire.com> wrote:
> I am building a JBoss sar and a JBoss wsr using the sar and wsr plugins.
> I would like to create these archives without including all of the jar
> dependencies. After looking at the documentation, I tried putting this
> into my dependency declaration in my pom:
>
>            <optional>true</optional>
>
> This doesn't appear to work the way the documentation states. In my
> project, I have one dependency: call it B. I have declared B to be
> optional in my pom. When I package my project, inside the archive, B has
> been filtered out, but all of B's dependencies are there. Basically what
> I want to have happen, is that I want to filter B and all its
> depedencies up the dependency hierarchy from being inside the archive.
>
> How can this be accomplished?
>
> Thanks.
>
> Brad
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: is there a way to filter dependency jars from being packaged

Posted by Ray Ward <wa...@gmail.com>.
I tried using the <provided> approach, and then things wouldn't compile.

I had to configure the ear plugin in the module that creates the ear file to
specifically exclude the jars that were required for compilation, but were
unneeded in the ear file.


On 3/6/06, Brad O'Hearne <br...@neurofire.com> wrote:
>
> Thanks Mang!  That worked!
>
> Brad
>
> Mang Jun Lau wrote:
>
> >You can try using <scope>provided</scope> for dependency B.
> >
> >
> >_Mang Lau
> >
> >
> >
> >
> >
> >Brad O'Hearne <br...@neurofire.com>
> >03/06/2006 02:37 PM
> >Please respond to
> >"Maven Users List" <us...@maven.apache.org>
> >
> >
> >To
> >Maven Users List <us...@maven.apache.org>
> >cc
> >
> >Subject
> >is there a way to filter dependency jars from being packaged
> >
> >
> >
> >
> >
> >
> >I am building a JBoss sar and a JBoss wsr using the sar and wsr plugins.
> >I would like to create these archives without including all of the jar
> >dependencies. After looking at the documentation, I tried putting this
> >into my dependency declaration in my pom:
> >
> >            <optional>true</optional>
> >
> >This doesn't appear to work the way the documentation states. In my
> >project, I have one dependency: call it B. I have declared B to be
> >optional in my pom. When I package my project, inside the archive, B has
> >been filtered out, but all of B's dependencies are there. Basically what
> >I want to have happen, is that I want to filter B and all its
> >depedencies up the dependency hierarchy from being inside the archive.
> >
> >How can this be accomplished?
> >
> >Thanks.
> >
> >Brad
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: is there a way to filter dependency jars from being packaged

Posted by Brad O'Hearne <br...@neurofire.com>.
Thanks Mang!  That worked!

Brad

Mang Jun Lau wrote:

>You can try using <scope>provided</scope> for dependency B.
>
>
>_Mang Lau
>
>
>
>
>
>Brad O'Hearne <br...@neurofire.com> 
>03/06/2006 02:37 PM
>Please respond to
>"Maven Users List" <us...@maven.apache.org>
>
>
>To
>Maven Users List <us...@maven.apache.org>
>cc
>
>Subject
>is there a way to filter dependency jars from being packaged
>
>
>
>
>
>
>I am building a JBoss sar and a JBoss wsr using the sar and wsr plugins. 
>I would like to create these archives without including all of the jar 
>dependencies. After looking at the documentation, I tried putting this 
>into my dependency declaration in my pom:
>
>            <optional>true</optional>
>
>This doesn't appear to work the way the documentation states. In my 
>project, I have one dependency: call it B. I have declared B to be 
>optional in my pom. When I package my project, inside the archive, B has 
>been filtered out, but all of B's dependencies are there. Basically what 
>I want to have happen, is that I want to filter B and all its 
>depedencies up the dependency hierarchy from being inside the archive.
>
>How can this be accomplished?
>
>Thanks.
>
>Brad
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
>
>  
>


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


Re: is there a way to filter dependency jars from being packaged

Posted by Mang Jun Lau <Ma...@otpp.com>.
You can try using <scope>provided</scope> for dependency B.


_Mang Lau





Brad O'Hearne <br...@neurofire.com> 
03/06/2006 02:37 PM
Please respond to
"Maven Users List" <us...@maven.apache.org>


To
Maven Users List <us...@maven.apache.org>
cc

Subject
is there a way to filter dependency jars from being packaged






I am building a JBoss sar and a JBoss wsr using the sar and wsr plugins. 
I would like to create these archives without including all of the jar 
dependencies. After looking at the documentation, I tried putting this 
into my dependency declaration in my pom:

            <optional>true</optional>

This doesn't appear to work the way the documentation states. In my 
project, I have one dependency: call it B. I have declared B to be 
optional in my pom. When I package my project, inside the archive, B has 
been filtered out, but all of B's dependencies are there. Basically what 
I want to have happen, is that I want to filter B and all its 
depedencies up the dependency hierarchy from being inside the archive.

How can this be accomplished?

Thanks.

Brad



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