Skip to content

Maven plugin - exclude dependencies - Doesn't work transitively #3602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tenstriker opened this issue Jul 25, 2015 · 11 comments
Closed

Maven plugin - exclude dependencies - Doesn't work transitively #3602

tenstriker opened this issue Jul 25, 2015 · 11 comments

Comments

@tenstriker
Copy link

I tried following to exclude all the artifacts under following groups

                 <configuration>
                <excludeGroupIds>org.apache.hadoop</excludeGroupIds>
                <excludeGroupIds>org.apache.hbase</excludeGroupIds>
            </configuration>

But it still left me with some jars . It should work same as maven-shade plugin artifactSet -> excludes in my opinion.

@wilkinsona
Copy link
Member

Duplicates #3426

@wilkinsona wilkinsona added the status: duplicate A duplicate of another issue label Jul 25, 2015
@tenstriker
Copy link
Author

Why not? In what scenario one would want child dependencies in their project when they don't want parents? Can there be a flag to exclude it conditionally at least?
Please re-open or give justifiable reason why this functionality is no supported.

@tenstriker
Copy link
Author

In my case I use 'excludeGroupIds' which should excludes all the artifacts under that group but that's is no happening.

screen shot 2015-07-25 at 10 05 05 am

e.g. hadoop-mapreduce-client-core, hadoop-yarn-common etc are all under same group id. If you can't exclude them then what is the point. I would happily use shade plugin but that plugin has its own issue as well working with spring-boot jars.

@wilkinsona
Copy link
Member

Ah, I see. That wasn't at all clear from the original description

@wilkinsona wilkinsona reopened this Jul 25, 2015
@wilkinsona wilkinsona removed the status: duplicate A duplicate of another issue label Jul 25, 2015
@snicoll
Copy link
Member

snicoll commented Jul 27, 2015

The doc states:

Comma separated list of groupId names to exclude (exact match).

Can you fix your configuration first please?

<configuration>
    <excludeGroupIds>org.apache.hadoop,org.apache.hbase</excludeGroupIds>
</configuration>

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Jul 27, 2015
@wilkinsona
Copy link
Member

Closing due to lack of requested feedback. If you'd like us to reopen the issue, please comment with the required information.

@wilkinsona wilkinsona removed the status: waiting-for-feedback We need additional information before we can continue label Oct 12, 2015
@tenstriker
Copy link
Author

@wilkinsona I tried comma-separated list of group ids. It still doesn't exclude child dependencies.

@wilkinsona
Copy link
Member

As explained in #3426, the exclusions are not applied transitively and it will only exclude artifacts with a group id that matches those specified in <excludeGroupIds>. I've just packaged an application and verified that all dependencies with a group id of org.apache.hadoop or org.apache.hbase are excluded, i.e. this is working as designed.

@zhuanqizhirou
Copy link

mvn dependency:copy-dependencies copy all jars to target/dependency;

mvn dependency:tree, get all groupIds, then it works.

@Aaaaaaron
Copy link

Can anyone reopen this issue? What's the point that if I want to just exclude a dependence without its dependence?

@snicoll
Copy link
Member

snicoll commented Jan 7, 2019

@Aaaaaaron please stop adding several comments on the same topic. If you have a question, ask on StackOverflow or chat with the community on Gitter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants