几天后詹金斯的测试就被取消了。我所犯的错误是:
配置根项目“MyAutomationTest”时出现问题。
没有找到名为“testCompile”的配置。
这是我的build.gradle文件:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "io.qameta.allure:allure-gradle:2.3"
}
}
group 'xyz'
version '1.0-SNAPSHOT'
apply plugin: 'io.qameta.allure'
repositories {
mavenCentral()
}
def props = new Properties()
file("testsConfig.properties").withInputStream { props.load(it) }
allure {
version = '2.4.1'
aspectjweaver = true
autoconfigure = true
resultsDir = file(props.getProperty("projectPath")+'/allure-results')
reportDir = file('raport/allure-results')
clean
}
apply plugin: 'java'
apply plugin: 'idea'
sourceCompatibility = 1.8
subprojects {
dependencies {
testCompile 'junit:junit:4.12'
testCompile 'io.appium:java-client:7.0.0'
testCompile 'org.assertj:asertj-core:3.12.2'
testCompile 'org.testng:testng:6.14.3'
testCompile 'io.qameta.allure:allure-testng:2.13.1'
testCompile 'log4j:log4j:1.2.17'
testCompile 'com.jcabi:jcabi-log:0.17.2'
testCompile 'org.slf4j:slf4j-log4j12:1.7.30'
testCompile 'org.testobject:testobject-appium-java-api:0.1.14'
testCompile 'io.rest-assured:rest-assured:4.3.2'
}
}
test {
System.setProperty("log4j.defaultInitOverride", "false")
dependsOn cleanTest
test.testLogging.showStandardStreams = false
useTestNG() {
systemProperties(props)
systemProperties = System.getProperties()
options.suites("src/test/resources/testng.xml")
}
}
我们在詹金斯的自动测试直到几天前还很正常。从那时起,他们就不会用这个问题一开始就出现的错误进行编译。在代码的依赖块中存在“实现组”,但我最近将其更改为testCompile。“实现组”工作得很好,但是它开始弹出testCompile的错误。根据我的理解,在将java插件应用到依赖项之后,配置应该在那里,但不知怎么的,它不起作用。
我试过的是:
我可以看到它使用/path/to/. Gradle /daemon/7.0,但最终会收到信息:在此构建中使用了废弃的Gradle特性,使得它与Gradle 8.0不兼容,但是我不认为Gradle本身是一个问题。之前,我们有一个7.0级,它是非常好的工作与给定的吐露,它总是弹出同样的错误。
如果可能的话请帮忙。
问候
发布于 2021-07-17 13:10:08
发布于 2021-12-28 15:10:18
如果您正在使用Kotlin,请将以下内容添加到build.gradle.kts
文件中:
val testCompile by configurations.creating
或
configurations {
create("testCompile")
}
发布于 2021-05-21 13:48:11
对于那些和我一样面临同样问题的人:
我通过"./ gradle“命令触发了gradle。我把它改成了"./gradlew“,它很有魅力。
https://stackoverflow.com/questions/67420176
复制相似问题