Skip to content

optional=true dependencies should be excluded by spring-boot:repackage #10137

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
ceefour opened this issue Sep 1, 2017 · 2 comments
Closed
Labels
status: invalid An issue that we don't feel is valid

Comments

@ceefour
Copy link
Contributor

ceefour commented Sep 1, 2017

For example:

[INFO] |  +- org.apache.wicket:wicket-ioc:jar:8.0.0-M7:compile
[INFO] |  |  +- cglib:cglib:jar:3.2.5:compile
[INFO] |  |  |  \- org.apache.ant:ant:jar:1.9.6:compile <-- this is optional dependency of cglib
[INFO] |  |  |     \- org.apache.ant:ant-launcher:jar:1.9.6:compile

As of Boot 1.5.7, the ant.jar is packaged. The correct behavior is that optional dependencies should be excluded, unless specifically added by the project itself. From https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html:

Optional dependencies - If project Y depends on project Z, the owner of project Y can mark project Z as an optional dependency, using the "optional" element. When project X depends on project Y, X will depend only on Y and not on Y's optional dependency Z. The owner of project X may then explicitly add a dependency on Z, at her option. (It may be helpful to think of optional dependencies as "excluded by default.")

Related to #649, #650, #8005

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 1, 2017
@wilkinsona
Copy link
Member

CGLib's Ant dependency is not optional. Here's its declaration in CGLib 3.2.5's pom:

<dependency>
    <groupId>org.apache.ant</groupId>
    <artifactId>ant</artifactId>
</dependency>

It is marked as optional in CGLib dependency management in their parent, but that has no effect. That's standard Maven behaviour and has nothing to do with Spring Boot.

@wilkinsona wilkinsona added status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 1, 2017
@ceefour
Copy link
Contributor Author

ceefour commented Sep 1, 2017

Thanks @wilkinsona for clarification. That means repackage behavior is as intended and cglib pom is buggy.

ceefour added a commit to ceefour/cglib that referenced this issue Sep 1, 2017
ant is not required for usage of cglib, hence should be marked as optional.
Related to spring-projects/spring-boot#10137 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants