I am using IntelliJ Idea 2022.3.2 Community Edition for this project.
I am trying to Build the project. When i perform ./gradlew build, there is the error i am getting
> Task :compileTestGroovy FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileTestGroovy'.
> java.lang.ExceptionInInitializerError (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
4 actionable tasks: 4 executed
When i do ./gradle --debug build, here are the results for the exact error location
2023-05-15T17:58:38.272+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2023-05-15T17:58:38.272+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
2023-05-15T17:58:38.272+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2023-05-15T17:58:38.272+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
2023-05-15T17:58:38.272+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':compileTestGroovy'.
2023-05-15T17:58:38.272+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > java.lang.ExceptionInInitializerError (no error message)
2023-05-15T17:58:38.272+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2023-05-15T17:58:38.272+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
2023-05-15T17:58:38.272+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. Run with --scan to get full insights.
2023-05-15T17:58:38.272+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2023-05-15T17:58:38.272+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
2023-05-15T17:58:38.272+0530 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger]
2023-05-15T17:58:38.272+0530 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 3s
2023-05-15T17:58:38.273+0530 [LIFECYCLE] [org.gradle.internal.buildevents.TaskExecutionStatisticsReporter] 4 actionable tasks: 2 executed, 2 up-to-date
Here are the versions of the tools i am using
------------------------------------------------------------
Gradle 6.3
------------------------------------------------------------
Build time: 2020-03-24 19:52:07 UTC
Revision: bacd40b727b0130eeac8855ae3f9fd9a0b207c60
Kotlin: 1.3.70
Groovy: 2.5.10
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 16.0.2 (Amazon.com Inc. 16.0.2+7)
OS: Mac OS X 13.1 x86_64
Here is the build.gradle file details
buildscript {
repositories {
jcenter()
maven {
url 'https://neimanmarcus.jfrog.io/artifactory/libs-release/'
credentials {
username = "${artifactory_user}"
password = "${artifactory_password}"
}
}
}
dependencies {
//Required for apply artifactory plugin
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:latest.release"
// classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.13.0"
// classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.31.9"
// Add spd suite generator to allow work with ExecDefinitions object and generate test plan
classpath "com.neimanmarcus.tests:spd-suite-generator:0.2.0"
}
}
plugins {
id "idea"
id "groovy"
id "com.energizedwork.webdriver-binaries" version "1.4"
id "com.energizedwork.idea-base" version "1.4"
}
//Enable "artifactory" for buildscript
apply plugin: 'com.jfrog.artifactory'
apply plugin: "groovy"
ext {
// The drivers we want to use
drivers = ["chrome", "chromeHeadless"]
ext {
groovyVersion = '2.4.15'
gebVersion = '7.0'
seleniumVersion = '4.2.2'
chromeDriverVersion = '89.0.4389.23'
}
}
repositories {
mavenCentral()
}
artifactory {
contextUrl = "${artifactory_contextUrl}" //The base Artifactory URL if not overridden by the publisher/resolver
resolve {
repository {
repoKey = 'libs-release'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
}
}
}
dependencies {
// If using Spock, need to depend on geb-spock
testImplementation "org.gebish:geb-spock:$gebVersion"
// https://mvnrepository.com/artifact/org.spockframework/spock-core
testImplementation("org.spockframework:spock-core:2.0-groovy-3.0") {
exclude group: 'org.codehaus.groovy'
}
// this will add the test fixtures of "my-lib" on the compile classpath of the tests of _this_ project
// testImplementation(testFixtures(project(":my-lib")))
// testImplementation 'org.spockframework.spock:spock-core:spock-2.4-M1'
// testImplementation("org.spockframework:spock-core:1.3-groovy-2.5") {
// testImplementation("org.spockframework.spock:spock-core:spock-2.4-M1") {
// exclude group: "org.codehaus.groovy"
// exclude module : 'groovy-all'
// }
testImplementation "org.codehaus.groovy:groovy-all:$groovyVersion"
// If setting form control values, need to depend on org.openqa.selenium.support.ui.Select
implementation group: 'org.seleniumhq.selenium', name: 'selenium-support', version: "$seleniumVersion"
implementation gradleApi()
implementation localGroovy()
implementation ('org.spockframework:spock-core:1.3-groovy-2.5')
// If using JUnit, need to depend on geb-junit (3 or 4)
testImplementation "org.gebish:geb-junit4:$gebVersion"
// Drivers
testImplementation "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion"
implementation group: 'com.neimanmarcus.tests', name: 'spd-client', version: '0.2.1'
implementation group: 'com.neimanmarcus.tests', name: 'tdm-client', version: '0.2.1'
implementation group: 'com.neimanmarcus.tests', name: 'spd-suite-generator', version: '0.2.1'
}
//task wrapper(type: Wrapper) {
// gradleVersion = "2.4"
//}
webdriverBinaries {
chromedriver chromeDriverVersion
}
drivers.each { driver ->
task "${driver}Test"(type: Test) {
//Pass system propeties to the java to allow work with execDefinition and Jenkins variable for SPD logging
systemProperties(System.getProperties())
group JavaBasePlugin.VERIFICATION_GROUP
outputs.upToDateWhen { false }
reports {
html.destination = reporting.file("$name/tests")
junitXml.destination = file("$buildDir/test-results/$name")
}
outputs.upToDateWhen { false } // Always run tests
systemProperty "geb.build.reportsDir", reporting.file("$name/geb")
systemProperty "geb.env", System.getProperty("geb.env")
systemProperty "geb.browser", driver
// This baseUrl will be used if geb.env is not set
// If geb.env is set, then baseUrl will be set in GebConfig.groovy
systemProperty "geb.build.baseUrl", System.getProperty("geb.baseUrl") ?: "http://localhost:3000"
if (System.getProperty("geb.env") && (System.getProperty("geb.baseUrl"))) {
throw new RuntimeException('Invalid parameters: Cannot set both "geb.baseUrl" and "geb.env"')
}
}
}
test {
dependsOn drivers.collect { tasks["${it}Test"] }
enabled = false
}
clean {
delete "logs", "out"
}
Here is the gradle-wrapper.properties file
#Fri Feb 24 17:26:56 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
Here is the gradle.properties details
org.gradle.daemon = true
artifactory_user=micserv
artifactory_password=AP2FMsTK4gXCQx4TYzpmMAY6yGk
#artifactory_contextUrl=http://jfrog.mynmg.com
artifactory_contextUrl=https://neimanmarcus.jfrog.io/artifactory/
#org.gradle.caching=true
Let me know where am i going wrong here