Gradle 提供的作用域在eclipse中不起作用
梯度2.2.1 我正在尝试将依赖项包含到一个jar文件中,并将其发送给其他用户。我希望他们提供自己版本的某些依赖项,并尝试模拟maven提供的Gradle 提供的作用域在eclipse中不起作用,gradle,Gradle,梯度2.2.1 我正在尝试将依赖项包含到一个jar文件中,并将其发送给其他用户。我希望他们提供自己版本的某些依赖项,并尝试模拟maven提供的范围 我遵循了教程。在eclipse集成部分之前,我能够从命令行成功地构建项目(同时仍然获得eclipse中未发现错误的类)。从帖子中,他说要添加eclipse.classpath.plusConfigurations+=configurations.provided,但我得到在配置容器上找不到属性“provided” apply plugin: 'jav
范围
我遵循了教程。在eclipse集成部分之前,我能够从命令行成功地构建项目(同时仍然获得eclipse中未发现错误的类)。从帖子中,他说要添加eclipse.classpath.plusConfigurations+=configurations.provided
,但我得到在配置容器上找不到属性“provided”
apply plugin: 'java'
apply plugin: 'eclipse'
// this causes the error
//eclipse.classpath.plusConfigurations += configurations.provided
sourceCompatibility = 1.8
version = '1.0'
jar {
manifest {
attributes 'Implementation-Title': '...',
'Implementation-Version': version
}
}
repositories {
mavenCentral()
}
configurations {
provided
}
sourceSets {
main.compileClasspath += configurations.provided
test.compileClasspath += configurations.provided
test.runtimeClasspath += configurations.provided
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.+'
//Jackson
provided 'com.fasterxml.jackson.core:jackson-core:2.6.2'
provided 'com.fasterxml.jackson.core:jackson-annotations:2.6.2'
provided 'com.fasterxml.jackson.core:jackson-databind:2.6.2'
}
test {
systemProperties 'property': 'value'
}
uploadArchives {
repositories {
flatDir {
dirs 'repos'
}
}
}
修好了
eclipse.classpath.plusConfigurations += configurations.provided
应该是一个数组
eclipse.classpath.plusConfigurations += [configurations.provided]
这太棒了,对我也很有用。非常感谢。