To support Escrow and Continuous Integration processes, the project has to be configured to use the org.octopusden.octopus.license-management
plugin.
build.gradle
plugins {
id 'org.octopusden.octopus.license-management'
}
settings.gradle
pluginManagement {
plugins {
id 'org.octopusden.octopus.license-management' version settings['license-management.version']
}
}
Applying the org.octopusden.octopus.license-management plugin with the buildscript
block:
build.gradle
buildscript {
dependencies {
classpath "org.octopusden.octopus.license-management:org.octopusden.octopus.license-management.gradle.plugin:${project.findProperty('license-management.version') ?: '{version-label}'}"
}
}
apply plugin: 'org.octopusden.octopus.license-management'
There are 2 strategies for processing:
Licenses of the root project and all subprojects are placed into the directory of the module declaring license plugin usage.
To include licenses in distribution, the output of the processLicenses
task should be used as source.
build.gradle
plugins {
id 'org.octopusden.octopus.license-management'
}
task componentDistribution(type: Zip) {
from (processLicenses) {
into 'licenses'
}
}
To include licenses in a JAR:
build.gradle
plugins {
id 'org.octopusden.octopus.license-management'
id 'java-library'
}
processResources {
from (processLicenses) {
into 'licenses'
}
}
Licenses of the module only are placed into the directory of the module declaring license plugin usage.
build.gradle
plugins {
id 'org.octopusden.octopus.license-management'
}
task componentDistribution(type: Zip) {
from (processModuleLicenses) {
into 'licenses'
}
}
To include licenses in a JAR:
build.gradle
plugins {
id 'org.octopusden.octopus.license-management'
id 'java-library'
}
processResources {
from (processModuleLicenses) {
into 'licenses'
}
}
To verify used licenses, specify a dependency for the build
task on the processLicenses
task.
build.gradle
plugins {
id 'org.octopusden.octopus.license-management'
id 'java-library'
}
build.dependsOn processLicenses
To process licenses (verify or include in distribution), set the project parameter license.skip
to false
(it is already configured on TeamCity C&UT standard templates).
gradle -Plicense.skip=false processLicenses
The Node packages license is a part of the org.octopusden.octopus.license-management
plugin.
Required Gradle version: 7.5.1 or above
To include licenses in distribution, the output of the processNpmLicenses
task should be used as source.
build.gradle
plugins {
id 'org.octopusden.octopus.license-management'
}
task componentDistribution(type: Zip) {
from (processNpmLicenses) {
into 'licenses'
}
}
To include both Gradle dependencies and JS licenses in a JAR:
build.gradle
plugins {
id 'org.octopusden.octopus.license-management'
id 'java-library'
}
processResources {
dependsOn('processLicenses', 'processNpmLicenses')
from(layout.buildDirectory.dir('licenses')) {
into 'licenses'
}
}
See NPM License Checker Options. Example:
build.gradle
plugins {
id 'org.octopusden.octopus.license-management'
}
processNpmLicenses {
start = file("$projectDir/node-app")
}
To process licenses (verify or include in distribution), set the project parameters license.skip
and node.skip
to false
.
gradle -Plicense.skip=false -Pnode.skip=false processNpmLicenses