使用hierynomus'获取空的许可证报告;gradle许可插件
我正在Gradle项目上制作两个android应用程序,并使用Hierynomus管理依赖许可证。 然后,我执行了以下命令:使用hierynomus'获取空的许可证报告;gradle许可插件,gradle,android-gradle-plugin,licensing,gradle-plugin,Gradle,Android Gradle Plugin,Licensing,Gradle Plugin,我正在Gradle项目上制作两个android应用程序,并使用Hierynomus管理依赖许可证。 然后,我执行了以下命令: $。/gradlew下载许可证 $cat./build/reports/license/dependency-license.json 但生成的许可证报告为空 {"dependencies":[]} 我试图解决以下文档的问题: 但我无法解决这个问题 接下来,我尝试使用--refresh dependencies和--reruntasks选项执行任务。遗憾的
$。/gradlew下载许可证
$cat./build/reports/license/dependency-license.json
但生成的许可证报告为空
{"dependencies":[]}
我试图解决以下文档的问题:
--refresh dependencies
和--reruntasks
选项执行任务。遗憾的是,问题还没有解决
这些是我的构建脚本:
// build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.21'
ext.kotlin_coroutine_version = '1.1.1'
repositories {
google()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.google.gms:google-services:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.12.1'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.21.0'
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "http://dl.bintray.com/jetbrains/spek" }
}
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'com.github.hierynomus.license'
downloadLicenses {
includeProjectDependencies = true
dependencyConfiguration = 'implementation'
ext.apacheTwo = license('Apache License, Version 2.0', 'https://opensource.org/licenses/Apache-2.0')
ext.bsd = license('BSD License', 'https://opensource.org/licenses/bsd-license')
aliases = [
(apacheTwo): [
'The Apache Software License, Version 2.0',
'Apache 2',
'Apache License Version 2.0',
'Apache License, Version 2.0',
'Apache License 2.0',
license('Apache License', 'https://www.apache.org/licenses/LICENSE-2.0')
],
(bsd): [
'BSD',
license('New BSD License', 'https://opensource.org/licenses/bsd-license')
]
]
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
毫无疑问,我希望我的项目的依赖项许可报告是在${project\u ROOT}/build/reports/license/
下生成的。我发现报告是生成的,但是,那些是空的
谢谢 版本0.15.0似乎有问题 对我来说,它与版本0.14.0和一些附加配置一起工作:
// buil.gradle root
plugins {
id "com.github.hierynomus.license" version "0.14.0"
}
downloadLicenses {
dependencyConfiguration = 'implementation'
includeProjectDependencies = true
}
// build.gradle app
apply plugin: 'com.github.hierynomus.license'
configurations.implementation.setCanBeResolved(true)
configurations.api.setCanBeResolved(true)
解决这个问题了吗?你是否向插件作者提交了一份报告?尝试其他插件?是的,最后我无法解决问题。我打开了一个插件的回购问题,但仍然没有解决。谢谢。这对我有用。我有一个基于java的spring boot项目。经过多次尝试和错误,它终于成功了。但是configurations.api会导致生成错误。所以我删除了configurations.api行,然后也删除了apply插件行,它仍然有效。我使用了gradle 6.7版本。
// client/build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
defaultConfig {
applicationId "xyz.tech-frodo.testFirebaseApp.client"
minSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-firestore:18.1.0'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutine_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$kotlin_coroutine_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutine_version"
implementation 'com.github.kittinunf.fuel:fuel:1.12.0'
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.9.4'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.maps:google-maps-services:0.9.3'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'org.jetbrains.spek:spek-api:1.1.5'
testImplementation 'org.jetbrains.spek:spek-junit-platform-engine:1.1.5'
testImplementation 'org.mockito:mockito-core:+'
testImplementation 'junit:junit:4.12'
testImplementation 'org.junit.platform:junit-platform-runner:1.1.0'
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
// buil.gradle root
plugins {
id "com.github.hierynomus.license" version "0.14.0"
}
downloadLicenses {
dependencyConfiguration = 'implementation'
includeProjectDependencies = true
}
// build.gradle app
apply plugin: 'com.github.hierynomus.license'
configurations.implementation.setCanBeResolved(true)
configurations.api.setCanBeResolved(true)