gpt4 book ai didi

java - 将依赖项添加到 jar 类路径 list

转载 作者:行者123 更新时间:2023-11-30 03:44:46 26 4
gpt4 key购买 nike

当我尝试将依赖项添加到 jar list 类路径时,它抛出异常:

用途:

等级2.1

构建:

apply plugin: 'java'

jar {
manifest {
attributes 'Implementation-Title': 'Main',
'Implementation-Version': version,
'Main-Class': 'com.apl.Main',
'Class-Path': configurations.compile.collect { it.getName() }.join(' ')
}
}

repositories {
flatDir {
dirs 'libs','test_libs'
}
}

dependencies {
compile name: 'bcmail-jdk16-dss'
compile name: 'bcprov-jdk16-dss'
compile name: 'bctsp-jdk16-dss'
}

异常(exception):

Caused by: org.gradle.api.InvalidUserDataException: You can't change configuration 'compile' because it is already resolved!

谁能帮我解决这个问题吗?

最佳答案

尝试放置

依赖项{
编译名称:'bcmail-jdk16-dss'
编译名称:'bcprov-jdk16-dss'
编译名称:'bctsp-jdk16-dss'
}

之前

    jar {
manifest {
attributes 'Implementation-Title': 'Main',
'Implementation-Version': version,
'Main-Class': 'com.apl.Main',
'Class-Path': configurations.compile.collect { it.getName() }.join(' ')
}
}

关于java - 将依赖项添加到 jar 类路径 list ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26014947/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com