diff --git a/core/src/main/java/com/devonfw/tools/solicitor/reader/gradle/GradleLicenseReportReader.java b/core/src/main/java/com/devonfw/tools/solicitor/reader/gradle/GradleLicenseReportReader.java new file mode 100644 index 00000000..0f24c9bf --- /dev/null +++ b/core/src/main/java/com/devonfw/tools/solicitor/reader/gradle/GradleLicenseReportReader.java @@ -0,0 +1,112 @@ +/** + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.devonfw.tools.solicitor.reader.gradle; + +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.springframework.stereotype.Component; + +import com.devonfw.tools.solicitor.common.PackageURLHelper; +import com.devonfw.tools.solicitor.common.SolicitorRuntimeException; +import com.devonfw.tools.solicitor.model.inventory.ApplicationComponent; +import com.devonfw.tools.solicitor.model.masterdata.Application; +import com.devonfw.tools.solicitor.model.masterdata.UsagePattern; +import com.devonfw.tools.solicitor.reader.AbstractReader; +import com.devonfw.tools.solicitor.reader.Reader; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +/** + * A {@link Reader} which reads data generated by the Gradle + * License Report Plugin. + */ +@Component +public class GradleLicenseReportReader extends AbstractReader implements Reader { + + /** + * The supported type of this {@link Reader}. + */ + public static final String SUPPORTED_TYPE = "gradle-license-report-json"; + + /** {@inheritDoc} */ + @Override + public Set getSupportedTypes() { + + return Collections.singleton(SUPPORTED_TYPE); + } + + /** {@inheritDoc} */ + @Override + public void readInventory(String type, String sourceUrl, Application application, UsagePattern usagePattern, + String repoType, String packageType, Map configuration) { + + int components = 0; + int licenses = 0; + + // According to tutorial https://github.com/FasterXML/jackson-databind/ + ObjectMapper mapper = new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT); + try { + Map report = mapper.readValue(this.inputStreamFactory.createInputStreamFor(sourceUrl), Map.class); + List> dependencies = report.get("dependencies"); + + // Extract groupId and artifactId + for (Map dependency : dependencies) { + String[] dependencyParts = dependency.get("moduleName").split(":"); + if (dependencyParts.length != 2) { + throw new SolicitorRuntimeException( + "Could not extract groupId, artifactId from moduleName: '" + dependency.get("moduleName") + "'"); + } + + ApplicationComponent appComponent = getModelFactory().newApplicationComponent(); + appComponent.setApplication(application); + appComponent.setGroupId(dependencyParts[0]); + appComponent.setArtifactId(dependencyParts[1]); + appComponent.setVersion(dependency.get("moduleVersion")); + + // Extract the first element from moduleUrls if available + Object urlsObject = dependency.get("moduleUrls"); + if (urlsObject instanceof List) { + List urlsList = (List) urlsObject; + if (!urlsList.isEmpty() && urlsList.get(0) instanceof String) { + appComponent.setOssHomepage((String) urlsList.get(0)); + } + } + + appComponent.setUsagePattern(usagePattern); + appComponent.setRepoType(repoType); + appComponent.setPackageUrl(PackageURLHelper + .fromMavenCoordinates(dependencyParts[0], dependencyParts[1], dependency.get("moduleVersion")).toString()); + + // Extract and process moduleLicenses + Object licensesObject = dependency.get("moduleLicenses"); + if (licensesObject instanceof List) { + List licensesList = (List) licensesObject; + for (Object licenseObject : licensesList) { + if (licenseObject instanceof Map) { + Map licenseMap = (Map) licenseObject; + String licenseName = (String) licenseMap.get("moduleLicense"); + String licenseUrl = (String) licenseMap.get("moduleLicenseUrl"); + addRawLicense(appComponent, licenseName, licenseUrl, sourceUrl); + } + } + } + + components++; + licenses++; + } + + doLogging(sourceUrl, application, components, licenses); + + } catch (IOException e) { + throw new SolicitorRuntimeException("Could not read Gradle License Report inventory source '" + sourceUrl + "'", + e); + } + } + +} diff --git a/core/src/main/java/com/devonfw/tools/solicitor/reader/gradle/GradleReader.java b/core/src/main/java/com/devonfw/tools/solicitor/reader/gradle/GradleReader.java deleted file mode 100644 index f1d910c4..00000000 --- a/core/src/main/java/com/devonfw/tools/solicitor/reader/gradle/GradleReader.java +++ /dev/null @@ -1,131 +0,0 @@ -/** - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.devonfw.tools.solicitor.reader.gradle; - -import java.io.IOException; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.devonfw.tools.solicitor.common.DeprecationChecker; -import com.devonfw.tools.solicitor.common.PackageURLHelper; -import com.devonfw.tools.solicitor.common.SolicitorRuntimeException; -import com.devonfw.tools.solicitor.model.inventory.ApplicationComponent; -import com.devonfw.tools.solicitor.model.masterdata.Application; -import com.devonfw.tools.solicitor.model.masterdata.UsagePattern; -import com.devonfw.tools.solicitor.reader.AbstractReader; -import com.devonfw.tools.solicitor.reader.Reader; -import com.devonfw.tools.solicitor.reader.gradle.model.Dependency; -import com.devonfw.tools.solicitor.reader.gradle.model.License; -import com.devonfw.tools.solicitor.reader.gradle.model.LicenseSummary; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; - -/** - * A {@link Reader} which reads data generated by the - * Gradle License Plugin. - *

- * The data mapping used by this class is inconsistent to the MavenReader. This class is only provided for backward - * compatibility. Use {@link GradleReader2} instead. - */ -@Component -public class GradleReader extends AbstractReader implements Reader { - - /** - * The supported type of this {@link Reader}. - */ - public static final String SUPPORTED_TYPE = "gradle"; - - private DeprecationChecker deprecationChecker; - - @Autowired - public void setDeprecationChecker(DeprecationChecker deprecationChecker) { - - this.deprecationChecker = deprecationChecker; - } - - /** {@inheritDoc} */ - @Override - public Set getSupportedTypes() { - - return Collections.singleton(SUPPORTED_TYPE); - } - - /** {@inheritDoc} */ - @Override - public void readInventory(String type, String sourceUrl, Application application, UsagePattern usagePattern, - String repoType, String packageType, Map configuration) { - - this.deprecationChecker.check(false, - "Use of Reader of type 'gradle' is deprecated, use 'gradle2' instead. See https://github.com/devonfw/solicitor/issues/58"); - int components = 0; - int licenses = 0; - LicenseSummary ls = new LicenseSummary(); - ls.setDependencies(new LinkedList()); - - // According to tutorial https://github.com/FasterXML/jackson-databind/ - ObjectMapper mapper = new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT); - try { - List l = mapper.readValue(this.inputStreamFactory.createInputStreamFor(sourceUrl), List.class); - for (Map m : l) { - Dependency dep = new Dependency(); - dep.setProject((String) m.get("project")); - dep.setVersion((String) m.get("version")); - dep.setUrl((String) m.get("url")); - dep.setYear((String) m.get("year")); - dep.setDependency((String) m.get("dependency")); - components++; - List lml = (List) m.get("licenses"); - List ll = new LinkedList(); - for (Map ml : lml) { - License license = new License(); - license.setLicense(ml.get("license")); - license.setLicense_url(ml.get("license_url")); - ll.add(license); - licenses++; - } - dep.setLicenses(ll); - ls.getDependencies().add(dep); - } - doLogging(sourceUrl, application, components, licenses); - - } catch (IOException e) { - throw new SolicitorRuntimeException("Could not read Gradle inventory source '" + sourceUrl + "'", e); - } - - for (Dependency dep : ls.getDependencies()) { - ApplicationComponent appComponent = getModelFactory().newApplicationComponent(); - appComponent.setApplication(application); - appComponent.setGroupId(dep.getProject()); - appComponent.setArtifactId(dep.getDependency()); - appComponent.setVersion(dep.getVersion()); - appComponent.setOssHomepage(dep.getUrl()); - appComponent.setUsagePattern(usagePattern); - appComponent.setRepoType(repoType); - String[] dependencyParts = dep.getDependency().split(":"); - if (dependencyParts.length != 3) { - throw new SolicitorRuntimeException( - "Could not extract groupId, artifactId and version from dependency info: '" + dep.getDependency() + "'"); - } - appComponent.setPackageUrl( - PackageURLHelper.fromMavenCoordinates(dependencyParts[0], dependencyParts[1], dependencyParts[2]).toString()); - if (dep.getLicenses().isEmpty()) { - // in case no license is found insert an empty entry - addRawLicense(appComponent, null, null, sourceUrl); - } else { - for (License lic : dep.getLicenses()) { - addRawLicense(appComponent, lic.getLicense(), lic.getLicense_url(), sourceUrl); - - } - } - } - } - -} diff --git a/core/src/main/java/com/devonfw/tools/solicitor/reader/gradle/GradleReader2.java b/core/src/main/java/com/devonfw/tools/solicitor/reader/gradle/GradleReader2.java index 006af338..6592612c 100644 --- a/core/src/main/java/com/devonfw/tools/solicitor/reader/gradle/GradleReader2.java +++ b/core/src/main/java/com/devonfw/tools/solicitor/reader/gradle/GradleReader2.java @@ -11,8 +11,10 @@ import java.util.Map; import java.util.Set; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import com.devonfw.tools.solicitor.common.DeprecationChecker; import com.devonfw.tools.solicitor.common.PackageURLHelper; import com.devonfw.tools.solicitor.common.SolicitorRuntimeException; import com.devonfw.tools.solicitor.model.inventory.ApplicationComponent; @@ -38,6 +40,14 @@ public class GradleReader2 extends AbstractReader implements Reader { */ public static final String SUPPORTED_TYPE = "gradle2"; + private DeprecationChecker deprecationChecker; + + @Autowired + public void setDeprecationChecker(DeprecationChecker deprecationChecker) { + + this.deprecationChecker = deprecationChecker; + } + /** {@inheritDoc} */ @Override public Set getSupportedTypes() { @@ -50,6 +60,10 @@ public Set getSupportedTypes() { public void readInventory(String type, String sourceUrl, Application application, UsagePattern usagePattern, String repoType, String packageType, Map configuration) { + this.deprecationChecker.check(false, + "Support for the 'Gradle License Plugin' via the 'gradle2' Reader is deprecated. Use the 'Gradle License Report' with" + + " Reader 'gradle-license-report-json' instead. See https://github.com/devonfw/solicitor/issues/283"); + int components = 0; int licenses = 0; LicenseSummary ls = new LicenseSummary(); diff --git a/core/src/test/java/com/devonfw/tools/solicitor/reader/gradle/GradleLicenseReportReaderTest.java b/core/src/test/java/com/devonfw/tools/solicitor/reader/gradle/GradleLicenseReportReaderTest.java new file mode 100644 index 00000000..bfe8084b --- /dev/null +++ b/core/src/test/java/com/devonfw/tools/solicitor/reader/gradle/GradleLicenseReportReaderTest.java @@ -0,0 +1,87 @@ +package com.devonfw.tools.solicitor.reader.gradle; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.List; + +import org.junit.jupiter.api.Test; + +import com.devonfw.tools.solicitor.common.FileInputStreamFactory; +import com.devonfw.tools.solicitor.model.ModelFactory; +import com.devonfw.tools.solicitor.model.impl.ModelFactoryImpl; +import com.devonfw.tools.solicitor.model.inventory.ApplicationComponent; +import com.devonfw.tools.solicitor.model.masterdata.Application; +import com.devonfw.tools.solicitor.model.masterdata.UsagePattern; + +class GradleLicenseReportReaderTest { + + Application application; + + public GradleLicenseReportReaderTest() { + + ModelFactory modelFactory = new ModelFactoryImpl(); + this.application = modelFactory.newApplication("testApp", "0.0.0.TEST", "1.1.2111", "http://bla.com", "Java8"); + GradleLicenseReportReader gr = new GradleLicenseReportReader(); + gr.setModelFactory(modelFactory); + gr.setInputStreamFactory(new FileInputStreamFactory()); + gr.readInventory("gradle-license-report-json", "src/test/resources/gradleLicenseReport.json", this.application, + UsagePattern.STATIC_LINKING, null, null, null); + } + + @Test + void testGetSupportedTypes() { + + GradleLicenseReportReader cut = new GradleLicenseReportReader(); + + assertEquals(1, cut.getSupportedTypes().size()); + assertTrue(cut.getSupportedTypes().contains("gradle-license-report-json")); + } + + @Test + void testFindArtifact() { + + List lapc = this.application.getApplicationComponents(); + boolean found = false; + for (ApplicationComponent ap : lapc) { + if (ap.getGroupId().equals("androidx.activity") && // + ap.getArtifactId().equals("activity") && // + ap.getVersion().equals("1.2.4")) { + found = true; + assertEquals("pkg:maven/androidx.activity/activity@1.2.4", ap.getPackageUrl()); + break; + } + } + assertEquals(3, lapc.size()); + assertTrue(found); + } + + @Test + void testFindLicense() { + + List lapc = this.application.getApplicationComponents(); + boolean found = false; + for (ApplicationComponent ap : lapc) { + if (ap.getArtifactId().equals("istack-commons-runtime") + && ap.getRawLicenses().get(0).getDeclaredLicense().equals("GPL2 w/ CPE")) { + found = true; + break; + } + } + assertTrue(found); + } + + @Test + void testMinimalInformation() { + + List lapc = this.application.getApplicationComponents(); + boolean found = false; + for (ApplicationComponent ap : lapc) { + if (ap.getArtifactId().equals("annotation") && ap.getOssHomepage() == null && ap.getRawLicenses().isEmpty()) { + found = true; + break; + } + } + assertTrue(found); + } +} \ No newline at end of file diff --git a/core/src/test/java/com/devonfw/tools/solicitor/reader/gradle/GradleReader2Tests.java b/core/src/test/java/com/devonfw/tools/solicitor/reader/gradle/GradleReader2Tests.java index dfc04abd..c7ab1aaa 100644 --- a/core/src/test/java/com/devonfw/tools/solicitor/reader/gradle/GradleReader2Tests.java +++ b/core/src/test/java/com/devonfw/tools/solicitor/reader/gradle/GradleReader2Tests.java @@ -13,6 +13,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.devonfw.tools.solicitor.common.DeprecationChecker; import com.devonfw.tools.solicitor.common.FileInputStreamFactory; import com.devonfw.tools.solicitor.model.ModelFactory; import com.devonfw.tools.solicitor.model.impl.ModelFactoryImpl; @@ -31,6 +32,14 @@ public GradleReader2Tests() { this.application = modelFactory.newApplication("testApp", "0.0.0.TEST", "1.1.2111", "http://bla.com", "Java8"); GradleReader2 gr = new GradleReader2(); + gr.setDeprecationChecker(new DeprecationChecker() { + + @Override + public void check(boolean warnOnly, String detailsString) { + + // do nothing... + } + }); gr.setModelFactory(modelFactory); gr.setInputStreamFactory(new FileInputStreamFactory()); gr.readInventory("gradle2", "src/test/resources/licenseReport.json", this.application, UsagePattern.DYNAMIC_LINKING, diff --git a/core/src/test/java/com/devonfw/tools/solicitor/reader/gradle/GradleReaderTests.java b/core/src/test/java/com/devonfw/tools/solicitor/reader/gradle/GradleReaderTests.java deleted file mode 100644 index 6dd8ee81..00000000 --- a/core/src/test/java/com/devonfw/tools/solicitor/reader/gradle/GradleReaderTests.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.devonfw.tools.solicitor.reader.gradle; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.util.List; - -import org.junit.jupiter.api.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.devonfw.tools.solicitor.common.DeprecationChecker; -import com.devonfw.tools.solicitor.common.FileInputStreamFactory; -import com.devonfw.tools.solicitor.model.ModelFactory; -import com.devonfw.tools.solicitor.model.impl.ModelFactoryImpl; -import com.devonfw.tools.solicitor.model.inventory.ApplicationComponent; -import com.devonfw.tools.solicitor.model.masterdata.Application; -import com.devonfw.tools.solicitor.model.masterdata.UsagePattern; - -public class GradleReaderTests { - private static final Logger LOG = LoggerFactory.getLogger(GradleReaderTests.class); - - Application application; - - public GradleReaderTests() { - - ModelFactory modelFactory = new ModelFactoryImpl(); - - this.application = modelFactory.newApplication("testApp", "0.0.0.TEST", "1.1.2111", "http://bla.com", "Java8"); - GradleReader gr = new GradleReader(); - gr.setDeprecationChecker(new DeprecationChecker() { - - @Override - public void check(boolean warnOnly, String detailsString) { - - // do nothing... - } - }); - gr.setModelFactory(modelFactory); - gr.setInputStreamFactory(new FileInputStreamFactory()); - gr.readInventory("gradle", "src/test/resources/licenseReport.json", this.application, UsagePattern.DYNAMIC_LINKING, - "maven", null, null); - - } - - @Test - public void findArtifact() { - - List lapc = this.application.getApplicationComponents(); - boolean found = false; - for (ApplicationComponent ap : lapc) { - if (ap.getArtifactId().equals("org.apache.xmlbeans:xmlbeans:3.0.2")) { - found = true; - assertEquals("pkg:maven/org.apache.xmlbeans/xmlbeans@3.0.2", ap.getPackageUrl()); - break; - } - } - assertTrue(found); - } - - @Test - public void readFileAndCheckSize() { - - LOG.info(this.application.toString()); - assertEquals(15, this.application.getApplicationComponents().size()); - } - - @Test - public void testFindLicense() { - - List lapc = this.application.getApplicationComponents(); - boolean found = false; - for (ApplicationComponent ap : lapc) { - if (ap.getArtifactId().equals("io.vavr:vavr-jackson:0.9.3") - && ap.getRawLicenses().get(0).getDeclaredLicense().equals("The Apache Software License, Version 2.0")) { - found = true; - break; - } - } - assertTrue(found); - } - - @Test - public void testFindLicense2() { - - List lapc = this.application.getApplicationComponents(); - boolean found = false; - for (ApplicationComponent ap : lapc) { - if (ap.getArtifactId().equals("com.github.virtuald:curvesapi:1.05") - && ap.getRawLicenses().get(0).getDeclaredLicense().equals("BSD License")) { - found = true; - break; - } - } - assertTrue(found); - } - - @Test - public void testFindLicense3() { - - List lapc = this.application.getApplicationComponents(); - boolean found = false; - for (ApplicationComponent ap : lapc) { - if (ap.getArtifactId().equals("com.fasterxml.jackson.core:jackson-core:2.9.4") && ap.getVersion().equals("2.9.4") - && ap.getRawLicenses().get(0).getDeclaredLicense().equals("The Apache Software License, Version 2.0")) { - found = true; - break; - } - } - assertTrue(found); - } -} diff --git a/core/src/test/resources/gradleLicenseReport.json b/core/src/test/resources/gradleLicenseReport.json new file mode 100644 index 00000000..48fa9bc7 --- /dev/null +++ b/core/src/test/resources/gradleLicenseReport.json @@ -0,0 +1,30 @@ +{ + "dependencies": [ + { + "moduleName": "androidx.activity:activity", + "moduleUrl": "https://developer.android.com/jetpack/androidx/releases/activity#1.2.4", + "moduleVersion": "1.2.4", + "moduleLicenses": [ + { + "moduleLicense": "The Apache Software License, Version 2.0", + "moduleLicenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.txt" + } + ] + }, + { + "moduleName": "com.sun.istack:istack-commons-runtime", + "moduleUrl": "http://www.oracle.com/", + "moduleVersion": "3.0.7", + "moduleLicenses": [ + { + "moduleLicense": "GPL2 w/ CPE", + "moduleLicenseUrl": "https://glassfish.java.net/public/CDDL+GPL_1_1.html" + } + ] + }, + { + "moduleName": "androidx.annotation:annotation", + "moduleVersion": "1.3.0" + } + ] +} diff --git a/documentation/files/gradleLicenseReport.json b/documentation/files/gradleLicenseReport.json new file mode 100644 index 00000000..c7267b98 --- /dev/null +++ b/documentation/files/gradleLicenseReport.json @@ -0,0 +1,38 @@ +{ + "dependencies": [ + { + "moduleName": "androidx.activity:activity", + "moduleVersion": "1.2.4", + "moduleUrls": [ + "https://developer.android.com/jetpack/androidx/releases/activity#1.2.4" + ], + "moduleLicenses": [ + { + "moduleLicense": "The Apache Software License, Version 2.0", + "moduleLicenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.txt" + } + ] + }, + { + "moduleName": "com.sun.activation:javax.activation", + "moduleVersion": "1.2.0", + "moduleUrls": [ + "http://www.oracle.com" + ], + "moduleLicenses": [ + { + "moduleLicense": "CDDL/GPLv2+CE", + "moduleLicenseUrl": "https://github.com/javaee/activation/blob/master/LICENSE.txt" + }, + { + "moduleLicense": "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0", + "moduleLicenseUrl": "https://opensource.org/licenses/CDDL-1.0" + } + ] + }, + { + "moduleName": "androidx.annotation:annotation", + "moduleVersion": "1.3.0" + } + ] +} diff --git a/documentation/master-solicitor.asciidoc b/documentation/master-solicitor.asciidoc index f5c167a5..93f2eba8 100644 --- a/documentation/master-solicitor.asciidoc +++ b/documentation/master-solicitor.asciidoc @@ -836,7 +836,62 @@ In _Solicitor_ the data is read with the following part of the config WARNING: The ORT reader currently does not yet fill the attribute `licenseUrl`. Any functionality/reporting based on this attribute will be disfunctional for data read by the ORT reader. -=== Gradle (Windows) +=== Gradle + +Gradle projects should use the https://github.com/jk1/Gradle-License-Report[Gradle License Report] to generate the Solicitor input files. Support for the https://github.com/jaredsburrows/gradle-license-plugin[Gradle License Plugin] is deprecated as it might lead to incomplete results. + +==== Gradle License Report Plugin + +Pick the correct version of the https://github.com/jk1/Gradle-License-Report[Gradle License Report Plugin] depending on you Gradle version. Add the plugin to the list of plugins in your `build.gradle` file: + +Gradle v7+: +---- +plugins { + id 'com.github.jk1.dependency-license-report' version '2.9' +} +---- + +Gradle v1.x to v6.x: +---- +plugins { + id 'com.github.jk1.dependency-license-report' version '1.17' +} +---- + +Add also the following to the `build.gradle` file to configure the plugin: +---- +import com.github.jk1.license.render.* +licenseReport { + configurations = ['runtimeClasspath', 'releaseRuntimeClasspath'] + + renderers = [new JsonReportRenderer('dependencies.json', false)] +} +---- + +Execute the plugin: +---- +gradle generateLicenseReport +---- + +The report is stored at `$projectfolder/build/reports/dependency-license/dependencies.json` and should look like this: +---- +include::files/gradleLicenseReport.json[] +---- + +In Solicitor the Data is read with the following part of the config + +---- + "readers" : [ { + "type" : ""type" : "gradle-license-report-json",", + "source" : "file:$/input/dependencies.json", + "usagePattern" : "DYNAMIC_LINKING" + } ] +---- + +==== gradle-license-plugin, Windows + +WARNING: The gradle-license-plugin does not include dependencies into the report if they have no license info declared. This might result in incomplete data in the Solicitor output. The usage +of this plugin is discouraged and the 'gradle2' reader is deprecated (stage 2). Use the <> instead. For the export of the licenses from a Gradle based project the Gradle License Plugin is used. @@ -882,9 +937,11 @@ In _Solicitor_ the data is read with the following part of the config } ] ---- -NOTE: The former reader of type `gradle` is deprecated and should no longer be used. See <>. +==== gradle-license-plugin, Android + +WARNING: The gradle-license-plugin does not include dependencies into the report if they have no license info declared. This might result in incomplete data in the Solicitor output. The usage +of this plugin is discouraged and the 'gradle2' reader is deprecated (stage 2). Use the <> instead. -=== Gradle (Android) For the Export of the the Licenses from a Gradle based Android Projects the Gradle License Plugin is used. To install the Plugin some changes need to be done in the build.gradle of the Project, like following example @@ -924,15 +981,13 @@ Source: https://github.com/jaredsburrows/gradle-license-plugin In Solicitor the Data is read with the following part of the config ---- -"readers" : [ { - "type" : "gradle2", - "source" : "file:$/input/licenses.json", - "usagePattern" : "DYNAMIC_LINKING" - } ] + "readers" : [ { + "type" : "gradle2", + "source" : "file:$/input/licenses.json", + "usagePattern" : "DYNAMIC_LINKING" + } ] ---- -NOTE: The former reader of type `gradle` is deprecated and should no longer be used. See <>. - === CycloneDX The CycloneDX reader can read SBOMs in CycloneDX 1.4 or 1.5 format (https://cyclonedx.org/specification/overview/). @@ -1421,13 +1476,13 @@ wrong/misleading output) the first stage of deprecation will be skipped. The following features are deprecated via the above mechanism: * Reader of type "npm-license-crawler-csv" (use Reader of type "npm-license-checker" instead); Stage 2 from Version 1.24.0 on; see https://github.com/devonfw/solicitor/issues/125 and https://github.com/devonfw/solicitor/issues/263 -* Reader of type "gradle" (use Reader of type "gradle2" instead); Stage 2 from Version 1.0.5 on; see https://github.com/devonfw/solicitor/issues/58 * Reader of type "npm"; Stage 2 from Version 1.24.0 on; see https://github.com/devonfw/solicitor/issues/62 and https://github.com/devonfw/solicitor/issues/263 * "REGEX:" prefix notation in rule templates (use "(REGEX)" suffix instead); Stage 2 from Version 1.24.0 on; see https://github.com/devonfw/solicitor/issues/78 and https://github.com/devonfw/solicitor/issues/263 * Use of `LicenseAssignmentProject.xls` decision table (use `LicenseAssignmentV2Project.xls` instead); Stage 2 from Version 1.24.0 on; see https://github.com/devonfw/solicitor/issues/263 * Use of `repoType` in the configuration of readers, see <>; Stage 2 from Version 1.24.0 on; see https://github.com/devonfw/solicitor/issues/190 and https://github.com/devonfw/solicitor/issues/263 * Running Solicitor on Java 8; Stage 1 from Version 1.22.0 on; see https://github.com/devonfw/solicitor/issues/247 * LicenseUrl guessing; Stage 1 from Version 1.23.0 on; see https://github.com/devonfw/solicitor/issues/255 +* Reader of type "gradle2" (use Gradle Licence Report and Reader of type "gradle-license-report-json" instead); Stage 2 from Version 1.27.0 on; see https://github.com/devonfw/solicitor/issues/283 == Experimental Scancode Integration @@ -1899,6 +1954,7 @@ Spring beans implementing this interface will be called at certain points in the [appendix] == Release Notes Changes in 1.27.0:: +* https://github.com/devonfw/solicitor/issues/283: New Reader for data generated by the Gradle License Report Plugin. See <>. Reader `gradle2` deprecated (stage 2). Reader `gradle` removed. Changes in 1.26.0:: * https://github.com/devonfw/solicitor/issues/281: Solicitor now assumes ScanCode v32 to be used within the ScanCode integration. ScanCode JSON result files of v30 and v31 can still be processed but the scripting for doing the scans assumes v32 to be installed.