Skip to content
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

Exclude unused transitive dependencies #3167

Merged
merged 1 commit into from
Nov 12, 2019
Merged

Exclude unused transitive dependencies #3167

merged 1 commit into from
Nov 12, 2019

Conversation

cesarsotovalero
Copy link
Contributor

Spoon depends direclty on org.eclipse.jdt.core. However, the dependencies org.eclipse.core.resources, org.eclipse.core.runtime, org.eclipse.core.filesystem, and org.eclipse.text are not used by Spoon and can be excluded safely.

These transitive dependencies with compile scope introduce bloat in the Spoon library as we can see in the current dependency tree:

+- org.eclipse.jdt:org.eclipse.jdt.core:jar:3.16.0:compile
|  +- org.eclipse.platform:org.eclipse.core.resources:jar:3.13.500:compile
|  |  +- org.eclipse.platform:org.eclipse.core.expressions:jar:3.6.500:compile
|  |  |  \- (org.eclipse.platform:org.eclipse.core.runtime:jar:3.16.0:compile - omitted for duplicate)
|  |  +- (org.eclipse.platform:org.eclipse.core.filesystem:jar:1.7.500:compile - omitted for duplicate)
|  |  \- (org.eclipse.platform:org.eclipse.core.runtime:jar:3.16.0:compile - omitted for duplicate)
|  +- org.eclipse.platform:org.eclipse.core.runtime:jar:3.16.0:compile
|  |  +- org.eclipse.platform:org.eclipse.osgi:jar:3.15.0:compile
|  |  +- org.eclipse.platform:org.eclipse.equinox.common:jar:3.10.500:compile
|  |  +- org.eclipse.platform:org.eclipse.core.jobs:jar:3.10.500:compile
|  |  |  \- (org.eclipse.platform:org.eclipse.equinox.common:jar:3.10.500:compile - omitted for duplicate)
|  |  +- org.eclipse.platform:org.eclipse.equinox.registry:jar:3.8.500:compile
|  |  |  \- (org.eclipse.platform:org.eclipse.equinox.common:jar:3.10.500:compile - omitted for duplicate)
|  |  +- org.eclipse.platform:org.eclipse.equinox.preferences:jar:3.7.500:compile
|  |  |  \- (org.eclipse.platform:org.eclipse.equinox.common:jar:3.10.500:compile - omitted for duplicate)
|  |  +- org.eclipse.platform:org.eclipse.core.contenttype:jar:3.7.400:compile
|  |  |  +- (org.eclipse.platform:org.eclipse.equinox.preferences:jar:3.7.500:compile - omitted for duplicate)
|  |  |  +- (org.eclipse.platform:org.eclipse.equinox.registry:jar:3.8.500:compile - omitted for duplicate)
|  |  |  \- (org.eclipse.platform:org.eclipse.equinox.common:jar:3.10.500:compile - omitted for duplicate)
|  |  \- org.eclipse.platform:org.eclipse.equinox.app:jar:1.4.300:compile
|  |     +- (org.eclipse.platform:org.eclipse.equinox.registry:jar:3.8.500:compile - omitted for duplicate)
|  |     \- (org.eclipse.platform:org.eclipse.equinox.common:jar:3.10.500:compile - omitted for duplicate)
|  +- org.eclipse.platform:org.eclipse.core.filesystem:jar:1.7.500:compile**
|  |  +- (org.eclipse.platform:org.eclipse.equinox.common:jar:3.10.500:compile - omitted for duplicate)
|  |  +- (org.eclipse.platform:org.eclipse.equinox.registry:jar:3.8.500:compile - omitted for duplicate)
|  |  \- (org.eclipse.platform:org.eclipse.osgi:jar:3.15.0:compile - omitted for duplicate)
|  \- org.eclipse.platform:org.eclipse.text:jar:3.9.0:compile
|     +- org.eclipse.platform:org.eclipse.core.commands:jar:3.9.500:compile
|     |  \- (org.eclipse.platform:org.eclipse.equinox.common:jar:3.10.500:compile - omitted for duplicate)
|     +- (org.eclipse.platform:org.eclipse.equinox.common:jar:3.10.500:compile - omitted for duplicate)
|     +- (org.eclipse.platform:org.eclipse.equinox.preferences:jar:3.7.500:compile - omitted for duplicate)
|     \- (org.eclipse.platform:org.eclipse.core.runtime:jar:3.16.0:compile - omitted for duplicate)

The transitive dependency com.infradna.tool:bridge-method-annotation of com.mysema.querydsl:querydsl-core can also be excluded because it is not used.

@monperrus
Copy link
Collaborator

Thanks a lot for the proposal. How much does this decrease the size of the with-dependencies jar file? (absolute and relative)

@cesarsotovalero
Copy link
Contributor Author

cesarsotovalero commented Nov 11, 2019

The reduction of the Spoon jar-with-dependencies, in terms of size and number of classes, is significant:

jar-with-dependencies Size (MB) #Classes
Before 16.2 7425
After 12.7 5593
Reduction (%) 27.6% 24.7%

@nharrand
Copy link
Collaborator

LGTM!

@nharrand nharrand merged commit 48be37f into INRIA:master Nov 12, 2019
@nharrand
Copy link
Collaborator

Thanks a lot for the contribution!

moraispgsi added a commit to TQRG/spoon that referenced this pull request Nov 25, 2019
refactor(pom.xml): exclude unused transitive dependencies (INRIA#3167)
@monperrus monperrus mentioned this pull request Mar 20, 2020
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

Successfully merging this pull request may close these issues.

3 participants