How to exclude artifacts inherited from a parent POM?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

How to exclude artifacts inherited from a parent POM?

mingleizhang-2
Hello, Maven Experts here.


         As the subject said, how to exclude artifacts inherited from a parent POM ?  Why did I ask this question as I used mvn dependency:analyze to find which dependency is unnecessary. And I found the following. All of them from the parent pom. And I can not exclude them like a normal way. Does anyone improve my mind here ? Thanks in advance.


Unused declared dependencies found:
[WARNING]    org.apache.flink:force-shading:jar:1.4-SNAPSHOT:compile
[WARNING]    org.powermock:powermock-module-junit4:jar:1.6.5:test
[WARNING]    com.google.code.findbugs:jsr305:jar:1.3.9:compile
[WARNING]    log4j:log4j:jar:1.2.17:test
[WARNING]    org.powermock:powermock-api-mockito:jar:1.6.5:test
[WARNING]    org.slf4j:slf4j-log4j12:jar:1.7.7:test


Cheers
Rice
Reply | Threaded
Open this post in threaded view
|

Re: How to exclude artifacts inherited from a parent POM?

Anders Hammar
The solution to this is to NOT have dependencies declared in a parent pom.
I know some want to do that to simplify in the projects inheriting, but
this is the downside of doing that. There is no way to fix this but to fix
the parent pom.

/Anders

On Sun, Sep 24, 2017 at 1:18 PM, mingleizhang <[hidden email]>
wrote:

> Hello, Maven Experts here.
>
>
>          As the subject said, how to exclude artifacts inherited from a
> parent POM ?  Why did I ask this question as I used mvn dependency:analyze
> to find which dependency is unnecessary. And I found the following. All of
> them from the parent pom. And I can not exclude them like a normal way.
> Does anyone improve my mind here ? Thanks in advance.
>
>
> Unused declared dependencies found:
> [WARNING]    org.apache.flink:force-shading:jar:1.4-SNAPSHOT:compile
> [WARNING]    org.powermock:powermock-module-junit4:jar:1.6.5:test
> [WARNING]    com.google.code.findbugs:jsr305:jar:1.3.9:compile
> [WARNING]    log4j:log4j:jar:1.2.17:test
> [WARNING]    org.powermock:powermock-api-mockito:jar:1.6.5:test
> [WARNING]    org.slf4j:slf4j-log4j12:jar:1.7.7:test
>
>
> Cheers
> Rice
Reply | Threaded
Open this post in threaded view
|

Re: How to exclude artifacts inherited from a parent POM?

Guang Chao
On Mon, Sep 25, 2017 at 2:38 AM, Anders Hammar <[hidden email]> wrote:

> The solution to this is to NOT have dependencies declared in a parent pom.
> I know some want to do that to simplify in the projects inheriting, but
> this is the downside of doing that. There is no way to fix this but to fix
> the parent pom.
>
>
Maybe just put the version in the parent POM as property, then declare the
dependency on the child POM.  That way, the consistency is preserved which
is same version for all POM.


> /Anders
>
> On Sun, Sep 24, 2017 at 1:18 PM, mingleizhang <[hidden email]>
> wrote:
>
> > Hello, Maven Experts here.
> >
> >
> >          As the subject said, how to exclude artifacts inherited from a
> > parent POM ?  Why did I ask this question as I used mvn
> dependency:analyze
> > to find which dependency is unnecessary. And I found the following. All
> of
> > them from the parent pom. And I can not exclude them like a normal way.
> > Does anyone improve my mind here ? Thanks in advance.
> >
> >
> > Unused declared dependencies found:
> > [WARNING]    org.apache.flink:force-shading:jar:1.4-SNAPSHOT:compile
> > [WARNING]    org.powermock:powermock-module-junit4:jar:1.6.5:test
> > [WARNING]    com.google.code.findbugs:jsr305:jar:1.3.9:compile
> > [WARNING]    log4j:log4j:jar:1.2.17:test
> > [WARNING]    org.powermock:powermock-api-mockito:jar:1.6.5:test
> > [WARNING]    org.slf4j:slf4j-log4j12:jar:1.7.7:test
> >
> >
> > Cheers
> > Rice
>



--
Guang <http://grails.asia/two-dimensional-string-array-in-java/>
Reply | Threaded
Open this post in threaded view
|

Re:Re: How to exclude artifacts inherited from a parent POM?

mingleizhang-2
The actual thing is I can not modify the pom in parent. That is my issue.








At 2017-09-28 09:03:38, "Guang Chao" <[hidden email]> wrote:

>On Mon, Sep 25, 2017 at 2:38 AM, Anders Hammar <[hidden email]> wrote:
>
>> The solution to this is to NOT have dependencies declared in a parent pom.
>> I know some want to do that to simplify in the projects inheriting, but
>> this is the downside of doing that. There is no way to fix this but to fix
>> the parent pom.
>>
>>
>Maybe just put the version in the parent POM as property, then declare the
>dependency on the child POM.  That way, the consistency is preserved which
>is same version for all POM.
>
>
>> /Anders
>>
>> On Sun, Sep 24, 2017 at 1:18 PM, mingleizhang <[hidden email]>
>> wrote:
>>
>> > Hello, Maven Experts here.
>> >
>> >
>> >          As the subject said, how to exclude artifacts inherited from a
>> > parent POM ?  Why did I ask this question as I used mvn
>> dependency:analyze
>> > to find which dependency is unnecessary. And I found the following. All
>> of
>> > them from the parent pom. And I can not exclude them like a normal way.
>> > Does anyone improve my mind here ? Thanks in advance.
>> >
>> >
>> > Unused declared dependencies found:
>> > [WARNING]    org.apache.flink:force-shading:jar:1.4-SNAPSHOT:compile
>> > [WARNING]    org.powermock:powermock-module-junit4:jar:1.6.5:test
>> > [WARNING]    com.google.code.findbugs:jsr305:jar:1.3.9:compile
>> > [WARNING]    log4j:log4j:jar:1.2.17:test
>> > [WARNING]    org.powermock:powermock-api-mockito:jar:1.6.5:test
>> > [WARNING]    org.slf4j:slf4j-log4j12:jar:1.7.7:test
>> >
>> >
>> > Cheers
>> > Rice
>>
>
>
>
>--
>Guang <http://grails.asia/two-dimensional-string-array-in-java/>
Reply | Threaded
Open this post in threaded view
|

Re: Re: How to exclude artifacts inherited from a parent POM?

Guang Chao
On Thu, Sep 28, 2017 at 9:14 AM, mingleizhang <[hidden email]>
wrote:

> The actual thing is I can not modify the pom in parent. That is my issue.
>
>
>
>
>
Can you try to put in exclusions section of dependencies in child pom if it
will work?


>
>
>
>
> At 2017-09-28 09:03:38, "Guang Chao" <[hidden email]> wrote:
> >On Mon, Sep 25, 2017 at 2:38 AM, Anders Hammar <[hidden email]> wrote:
> >
> >> The solution to this is to NOT have dependencies declared in a parent
> pom.
> >> I know some want to do that to simplify in the projects inheriting, but
> >> this is the downside of doing that. There is no way to fix this but to
> fix
> >> the parent pom.
> >>
> >>
> >Maybe just put the version in the parent POM as property, then declare the
> >dependency on the child POM.  That way, the consistency is preserved which
> >is same version for all POM.
> >
> >
> >> /Anders
> >>
> >> On Sun, Sep 24, 2017 at 1:18 PM, mingleizhang <[hidden email]>
> >> wrote:
> >>
> >> > Hello, Maven Experts here.
> >> >
> >> >
> >> >          As the subject said, how to exclude artifacts inherited from
> a
> >> > parent POM ?  Why did I ask this question as I used mvn
> >> dependency:analyze
> >> > to find which dependency is unnecessary. And I found the following.
> All
> >> of
> >> > them from the parent pom. And I can not exclude them like a normal
> way.
> >> > Does anyone improve my mind here ? Thanks in advance.
> >> >
> >> >
> >> > Unused declared dependencies found:
> >> > [WARNING]    org.apache.flink:force-shading:jar:1.4-SNAPSHOT:compile
> >> > [WARNING]    org.powermock:powermock-module-junit4:jar:1.6.5:test
> >> > [WARNING]    com.google.code.findbugs:jsr305:jar:1.3.9:compile
> >> > [WARNING]    log4j:log4j:jar:1.2.17:test
> >> > [WARNING]    org.powermock:powermock-api-mockito:jar:1.6.5:test
> >> > [WARNING]    org.slf4j:slf4j-log4j12:jar:1.7.7:test
> >> >
> >> >
> >> > Cheers
> >> > Rice
> >>
> >
> >
> >
> >--
> >Guang <http://grails.asia/two-dimensional-string-array-in-java/>
>



--
Guang <http://grails.asia/byte-array-to-string-in-java/>
Reply | Threaded
Open this post in threaded view
|

Re: How to exclude artifacts inherited from a parent POM?

Russell Gold-3
In reply to this post by mingleizhang-2
What problem is caused by the superfluous dependencies?

> On Sep 27, 2017, at 9:14 PM, mingleizhang <[hidden email]> wrote:
>
> The actual thing is I can not modify the pom in parent. That is my issue.
>
>
>
>
>
>
>
>
> At 2017-09-28 09:03:38, "Guang Chao" <[hidden email]> wrote:
>> On Mon, Sep 25, 2017 at 2:38 AM, Anders Hammar <[hidden email]> wrote:
>>
>>> The solution to this is to NOT have dependencies declared in a parent pom.
>>> I know some want to do that to simplify in the projects inheriting, but
>>> this is the downside of doing that. There is no way to fix this but to fix
>>> the parent pom.
>>>
>>>
>> Maybe just put the version in the parent POM as property, then declare the
>> dependency on the child POM.  That way, the consistency is preserved which
>> is same version for all POM.
>>
>>
>>> /Anders
>>>
>>> On Sun, Sep 24, 2017 at 1:18 PM, mingleizhang <[hidden email]>
>>> wrote:
>>>
>>>> Hello, Maven Experts here.
>>>>
>>>>
>>>>         As the subject said, how to exclude artifacts inherited from a
>>>> parent POM ?  Why did I ask this question as I used mvn
>>> dependency:analyze
>>>> to find which dependency is unnecessary. And I found the following. All
>>> of
>>>> them from the parent pom. And I can not exclude them like a normal way.
>>>> Does anyone improve my mind here ? Thanks in advance.
>>>>
>>>>
>>>> Unused declared dependencies found:
>>>> [WARNING]    org.apache.flink:force-shading:jar:1.4-SNAPSHOT:compile
>>>> [WARNING]    org.powermock:powermock-module-junit4:jar:1.6.5:test
>>>> [WARNING]    com.google.code.findbugs:jsr305:jar:1.3.9:compile
>>>> [WARNING]    log4j:log4j:jar:1.2.17:test
>>>> [WARNING]    org.powermock:powermock-api-mockito:jar:1.6.5:test
>>>> [WARNING]    org.slf4j:slf4j-log4j12:jar:1.7.7:test
>>>>
>>>>
>>>> Cheers
>>>> Rice
>>>
>>
>>
>>
>> --
>> Guang <http://grails.asia/two-dimensional-string-array-in-java/>


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

Reply | Threaded
Open this post in threaded view
|

Re: How to exclude artifacts inherited from a parent POM?

mingleizhang-2
In reply to this post by Guang Chao
No. I can not.




|
| |
mingleizhang
|
|
邮箱:[hidden email]
|
|



在2017年09月28日 13:14,Guang Chao 写道:
On Thu, Sep 28, 2017 at 9:14 AM, mingleizhang <[hidden email]>
wrote:

> The actual thing is I can not modify the pom in parent. That is my issue.
>
>
>
>
>
Can you try to put in exclusions section of dependencies in child pom if it
will work?


>
>
>
>
> At 2017-09-28 09:03:38, "Guang Chao" <[hidden email]> wrote:
> >On Mon, Sep 25, 2017 at 2:38 AM, Anders Hammar <[hidden email]> wrote:
> >
> >> The solution to this is to NOT have dependencies declared in a parent
> pom.
> >> I know some want to do that to simplify in the projects inheriting, but
> >> this is the downside of doing that. There is no way to fix this but to
> fix
> >> the parent pom.
> >>
> >>
> >Maybe just put the version in the parent POM as property, then declare the
> >dependency on the child POM.  That way, the consistency is preserved which
> >is same version for all POM.
> >
> >
> >> /Anders
> >>
> >> On Sun, Sep 24, 2017 at 1:18 PM, mingleizhang <[hidden email]>
> >> wrote:
> >>
> >> > Hello, Maven Experts here.
> >> >
> >> >
> >> >          As the subject said, how to exclude artifacts inherited from
> a
> >> > parent POM ?  Why did I ask this question as I used mvn
> >> dependency:analyze
> >> > to find which dependency is unnecessary. And I found the following.
> All
> >> of
> >> > them from the parent pom. And I can not exclude them like a normal
> way.
> >> > Does anyone improve my mind here ? Thanks in advance.
> >> >
> >> >
> >> > Unused declared dependencies found:
> >> > [WARNING]    org.apache.flink:force-shading:jar:1.4-SNAPSHOT:compile
> >> > [WARNING]    org.powermock:powermock-module-junit4:jar:1.6.5:test
> >> > [WARNING]    com.google.code.findbugs:jsr305:jar:1.3.9:compile
> >> > [WARNING]    log4j:log4j:jar:1.2.17:test
> >> > [WARNING]    org.powermock:powermock-api-mockito:jar:1.6.5:test
> >> > [WARNING]    org.slf4j:slf4j-log4j12:jar:1.7.7:test
> >> >
> >> >
> >> > Cheers
> >> > Rice
> >>
> >
> >
> >
> >--
> >Guang <http://grails.asia/two-dimensional-string-array-in-java/&gt;
>



--
Guang <http://grails.asia/byte-array-to-string-in-java/&gt;
Reply | Threaded
Open this post in threaded view
|

Re: How to exclude artifacts inherited from a parent POM?

Guang Chao
In reply to this post by Russell Gold-3
On Thu, Sep 28, 2017 at 2:56 PM, Russell Gold <[hidden email]>
wrote:

> What problem is caused by the superfluous dependencies?
>

I think he wants to get rid of the warnings.


>
> > On Sep 27, 2017, at 9:14 PM, mingleizhang <[hidden email]>
> wrote:
> >
> > The actual thing is I can not modify the pom in parent. That is my issue.
> >
> >
> >
> >
> >
> >
> >
> >
> > At 2017-09-28 09:03:38, "Guang Chao" <[hidden email]> wrote:
> >> On Mon, Sep 25, 2017 at 2:38 AM, Anders Hammar <[hidden email]>
> wrote:
> >>
> >>> The solution to this is to NOT have dependencies declared in a parent
> pom.
> >>> I know some want to do that to simplify in the projects inheriting, but
> >>> this is the downside of doing that. There is no way to fix this but to
> fix
> >>> the parent pom.
> >>>
> >>>
> >> Maybe just put the version in the parent POM as property, then declare
> the
> >> dependency on the child POM.  That way, the consistency is preserved
> which
> >> is same version for all POM.
> >>
> >>
> >>> /Anders
> >>>
> >>> On Sun, Sep 24, 2017 at 1:18 PM, mingleizhang <[hidden email]>
> >>> wrote:
> >>>
> >>>> Hello, Maven Experts here.
> >>>>
> >>>>
> >>>>         As the subject said, how to exclude artifacts inherited from a
> >>>> parent POM ?  Why did I ask this question as I used mvn
> >>> dependency:analyze
> >>>> to find which dependency is unnecessary. And I found the following.
> All
> >>> of
> >>>> them from the parent pom. And I can not exclude them like a normal
> way.
> >>>> Does anyone improve my mind here ? Thanks in advance.
> >>>>
> >>>>
> >>>> Unused declared dependencies found:
> >>>> [WARNING]    org.apache.flink:force-shading:jar:1.4-SNAPSHOT:compile
> >>>> [WARNING]    org.powermock:powermock-module-junit4:jar:1.6.5:test
> >>>> [WARNING]    com.google.code.findbugs:jsr305:jar:1.3.9:compile
> >>>> [WARNING]    log4j:log4j:jar:1.2.17:test
> >>>> [WARNING]    org.powermock:powermock-api-mockito:jar:1.6.5:test
> >>>> [WARNING]    org.slf4j:slf4j-log4j12:jar:1.7.7:test
> >>>>
> >>>>
> >>>> Cheers
> >>>> Rice
> >>>
> >>
> >>
> >>
> >> --
> >> Guang <http://grails.asia/two-dimensional-string-array-in-java/>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Guang <http://grails.asia/java-5-for-loop-string-array/>
Reply | Threaded
Open this post in threaded view
|

Re: How to exclude artifacts inherited from a parent POM?

Anders Hammar
On Fri, Sep 29, 2017 at 8:00 AM, Guang Chao <[hidden email]>
wrote:

> On Thu, Sep 28, 2017 at 2:56 PM, Russell Gold <[hidden email]>
> wrote:
>
> > What problem is caused by the superfluous dependencies?
> >
>
> I think he wants to get rid of the warnings.
>

There is no way but to remove those dependencies from the parent pom
itself. File a ticket on those managing it if you can't fix it yourself.

/Anders



>
>
> >
> > > On Sep 27, 2017, at 9:14 PM, mingleizhang <[hidden email]>
> > wrote:
> > >
> > > The actual thing is I can not modify the pom in parent. That is my
> issue.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > At 2017-09-28 09:03:38, "Guang Chao" <[hidden email]>
> wrote:
> > >> On Mon, Sep 25, 2017 at 2:38 AM, Anders Hammar <[hidden email]>
> > wrote:
> > >>
> > >>> The solution to this is to NOT have dependencies declared in a parent
> > pom.
> > >>> I know some want to do that to simplify in the projects inheriting,
> but
> > >>> this is the downside of doing that. There is no way to fix this but
> to
> > fix
> > >>> the parent pom.
> > >>>
> > >>>
> > >> Maybe just put the version in the parent POM as property, then declare
> > the
> > >> dependency on the child POM.  That way, the consistency is preserved
> > which
> > >> is same version for all POM.
> > >>
> > >>
> > >>> /Anders
> > >>>
> > >>> On Sun, Sep 24, 2017 at 1:18 PM, mingleizhang <
> [hidden email]>
> > >>> wrote:
> > >>>
> > >>>> Hello, Maven Experts here.
> > >>>>
> > >>>>
> > >>>>         As the subject said, how to exclude artifacts inherited
> from a
> > >>>> parent POM ?  Why did I ask this question as I used mvn
> > >>> dependency:analyze
> > >>>> to find which dependency is unnecessary. And I found the following.
> > All
> > >>> of
> > >>>> them from the parent pom. And I can not exclude them like a normal
> > way.
> > >>>> Does anyone improve my mind here ? Thanks in advance.
> > >>>>
> > >>>>
> > >>>> Unused declared dependencies found:
> > >>>> [WARNING]    org.apache.flink:force-shading:jar:1.4-SNAPSHOT:
> compile
> > >>>> [WARNING]    org.powermock:powermock-module-junit4:jar:1.6.5:test
> > >>>> [WARNING]    com.google.code.findbugs:jsr305:jar:1.3.9:compile
> > >>>> [WARNING]    log4j:log4j:jar:1.2.17:test
> > >>>> [WARNING]    org.powermock:powermock-api-mockito:jar:1.6.5:test
> > >>>> [WARNING]    org.slf4j:slf4j-log4j12:jar:1.7.7:test
> > >>>>
> > >>>>
> > >>>> Cheers
> > >>>> Rice
> > >>>
> > >>
> > >>
> > >>
> > >> --
> > >> Guang <http://grails.asia/two-dimensional-string-array-in-java/>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
>
> --
> Guang <http://grails.asia/java-5-for-loop-string-array/>
>