-
Bug
-
Resolution: Fixed
-
Medium
-
4.0.0, 4.1.0, 4.2.0
-
None
Plugins which use a <scope>import</scope> for the com.atlassian.bitbucket.server:bitbucket-parent POM and have dependencies on certain modules, like bitbucket-spi, end up unexpectedly bundling commons-lang:commons-lang.
In bitbucket-parent, the commons-lang:commons-lang entry in <dependencyManagement/> has an explicit <scope>runtime</scope> applied. When commons-lang is pulled in transitively via a <scope>provided</scope> dependency, that explicit "runtime" ends up overriding the "provided" scope. As a result, commons-lang is bundled in the plugin.
[BSERV-8228] Plugins built with some Bitbucket Server dependencies unexpectedly bundle commons-lang
Workflow | Original: Stash Workflow - Restricted [ 1447580 ] | New: JAC Bug Workflow v3 [ 3136307 ] |
Fix Version/s | New: 4.2.1 [ 60450 ] | |
Fix Version/s | New: 4.1.4 [ 60532 ] | |
Fix Version/s | New: 4.0.7 [ 60448 ] |
Workflow | Original: Stash Workflow [ 1034434 ] | New: Stash Workflow - Restricted [ 1447580 ] |
Fix Version/s | New: 4.3.0 [ 60291 ] | |
Resolution | New: Fixed [ 1 ] | |
Status | Original: Open [ 1 ] | New: Closed [ 6 ] |
Status | Original: Needs Triage [ 10030 ] | New: Open [ 1 ] |
Summary | Original: Plugins built with some Bitbucket Server dependencies unexpected bundle commons-lang | New: Plugins built with some Bitbucket Server dependencies unexpectedly bundle commons-lang |
I built a very simple plugin, which has dependencies on bitbucket-api and bitbucket-spi. I noticed that the resulting plugin jar was significantly larger than I expected, so I looked inside and found all of the commons-lang classes.
A quick glance through mvn dependency:tree quickly showed the culprit:
So bitbucket-spi is in <scope>provided</scope>, but commons-lang is <scope>runtime</scope>. A quick glance at bitbucket-parent, which is being imported to leverage its versions, shows:
Removing that explicit <scope/> tag results in: