bndtools / bnd

Bnd/Bndtools. Tooling to build OSGi bundles including Eclipse, Maven, and Gradle plugins.
https://bndtools.org
Other
528 stars 306 forks source link

Hardly readable warning regarding 'multiple jars provide the same package' #1277

Closed xtracoder closed 8 years ago

xtracoder commented 8 years ago

In case of multiple warnings 'multiple jars provide the same package', they are concatenated without \n - it causes misunderstanding about actually displayed warning. Here is sample output:

[Split package, multiple jars provide the same package:org/apache/poi/ss/usermodel
Use Import/Export Package directive -split-package:=(merge-first|merge-last|error|first) to get rid of this warning
Package found in   [Jar:poi-ooxml-3.10.1, Jar:poi-3.10.1]
Class path         [Jar:commons-lang3-3.4, Jar:dom4j-1.6.1, Jar:poi-ooxml-schemas-3.10.1, Jar:poi-ooxml-3.10.1, Jar:poi-3.10.1, Jar:velocity-1.7, Jar:xmlbeans-2.6.0, Jar:xml-apis-1.0.b2, Jar:commons-codec-1.5, Jar:commons-collections-3.2.1, Jar:commons-lang-2.4, Jar:stax-api-1.0.1, Jar:main], Split package, multiple jars provide the same package:org/apache/poi/util
Use Import/Export Package directive -split-package:=(merge-first|merge-last|error|first) to get rid of this warning
Package found in   [Jar:poi-ooxml-3.10.1, Jar:poi-3.10.1]
Class path         [Jar:commons-lang3-3.4, Jar:dom4j-1.6.1, Jar:poi-ooxml-schemas-3.10.1, Jar:poi-ooxml-3.10.1, Jar:poi-3.10.1, Jar:velocity-1.7, Jar:xmlbeans-2.6.0, Jar:xml-apis-1.0.b2, Jar:commons-codec-1.5, Jar:commons-collections-3.2.1, Jar:commons-lang-2.4, Jar:stax-api-1.0.1, Jar:main], Split package, multiple jars provide the same package:org/apache/poi
Use Import/Export Package directive -split-package:=(merge-first|merge-last|error|first) to get rid of this warning
Package found in   [Jar:poi-ooxml-3.10.1, Jar:poi-3.10.1]
Class path         [Jar:commons-lang3-3.4, Jar:dom4j-1.6.1, Jar:poi-ooxml-schemas-3.10.1, Jar:poi-ooxml-3.10.1, Jar:poi-3.10.1, Jar:velocity-1.7, Jar:xmlbeans-2.6.0, Jar:xml-apis-1.0.b2, Jar:commons-codec-1.5, Jar:commons-collections-3.2.1, Jar:commons-lang-2.4, Jar:stax-api-1.0.1, Jar:main], Split package, multiple jars provide the same package:org/apache/poi/dev
Use Import/Export Package directive -split-package:=(merge-first|merge-last|error|first) to get rid of this warning
Package found in   [Jar:poi-ooxml-3.10.1, Jar:poi-3.10.1]
Class path         [Jar:commons-lang3-3.4, Jar:dom4j-1.6.1, Jar:poi-ooxml-schemas-3.10.1, Jar:poi-ooxml-3.10.1, Jar:poi-3.10.1, Jar:velocity-1.7, Jar:xmlbeans-2.6.0, Jar:xml-apis-1.0.b2, Jar:commons-codec-1.5, Jar:commons-collections-3.2.1, Jar:commons-lang-2.4, Jar:stax-api-1.0.1, Jar:main]]
bjhargrave commented 8 years ago

This output is not the fault of bnd. It is the fault of the gradle plugin you use. See https://github.com/TomDmitriev/gradle-bundle-plugin/blob/master/src/main/groovy/org/dm/gradle/plugins/bundle/JarBuilder.groovy#L130-L140. It converts the List<String> returned from bnd into a String and then logs it. This results in logging one long string rather than multiple strings.

Since you do not use the standard bnd gradle plugin, you should check any issues you have with the gradle plugin you do use before reporting them here to ensure they are not the fault of that code driving bnd. Thanks.