jenkinsci / gradle-jpi-plugin

Build Jenkins Plugins with Gradle
79 stars 50 forks source link

generateLicenseInfo Silently Omits License from POMs with Declared Namespace #154

Closed sghill closed 4 years ago

sghill commented 4 years ago

In order to produce license info As a gradle-jpi-plugin user I want one or more of the following:

If a dependency is resolved with Gradle Module Metadata instead of a POM, the description tag has an empty body and the license tag is missing:

<l:dependency version='1.3.61' artifactId='kotlin-stdlib' groupId='org.jetbrains.kotlin' name='' url=''>
    <l:description></l:description>
</l:dependency>

Contrast this with the info generated from a POM:

<l:dependency version='1.4' artifactId='xmlunit' groupId='xmlunit' name='XMLUnit for Java' url='http://xmlunit.sourceforge.net/'>
    <l:description>XMLUnit compares a control XML document to a test document or the result of a transformation, validates documents, and compares the results of XPath expressions.</l:description>
    <l:license url='http://xmlunit.svn.sourceforge.net/viewvc/*checkout*/xmlunit/trunk/xmlunit/LICENSE.txt' name='BSD License'/>
</l:dependency>

This behavior makes sense because there is no license information present in Gradle Module Metadata as of 1.1. However, it is surprising to see the task succeed with this information missing.

Created this issue while investigating #153.

jjohannes commented 4 years ago

I think when Gradle Module Metadata is used, the plugin should still take the license from the POM file. Gradle Metadata does not contain that information at the moment as it is seen as an addition to the POM - i.e. in a default setup, there is always the POM + the module file.

If I remember correctly, the pom file is explicitly fetched for reading the license already.