-
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.
Form Name |
---|
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: