since a few days tests in Jenkins are being canceled. The error I got in there is:
A problem occurred configuring root project 'MyAutomationTests'.
Configuration with name 'testCompile' not found.
This is my build.gradle file:
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")
}
}
Our automatic tests in Jenkins were working fine until a few days ago. Since then they do not compile with error given on the very beginning of this issue. There was 'implementation group' in the dependencies block of code but I recently changed it to testCompile. 'implementation group' was working just fine but it started to pop out error with the testCompile. In my understanding after I apply java plugin to the dependencies the configuration should be there but somehow it does not work.
What I tried:
I can see it uses /path/to/.gradle/daemon/7.0 but receive information on the end: Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0 however I do not suppose the Gradle itself is a problem. Before we had an gradle 7.0 and it was working perfectly fine with the given confioguration and it was always popping the same error.
Please help if it is possible.
Regards
The workaround mentioned in this link works fine with me
All you need to do is to add the following block of code to build.gradle file:
configurations {
testCompile
}
In case one is using Kotlin DSL, add the following to build.gradle.kts file:
val testCompile by configurations.creating
or
configurations {
create("testCompile")
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With