英文:
TestNG libs not downloaded while using gradle
问题
I am new to gradle and have rarely used maven also before. I have built a Automation Framework using TestNG and adding wrapper around TestNG. Now I want to make it as a gradle project. I am using the below content in the build.gradle.
plugins {
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
}
//mainClassName = "mainclass"
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
implementation group: 'javax.json', name: 'javax.json-api', version: '1.1.4'
implementation group: 'org.testng', name: 'testng', version: '7.7.1'
}
In this case only javax-json-api.jar is downloaded and added to the 'Projects and External Dependencies' section in Eclipse. TestNG doesn't get downloaded and Eclipse shows me the compilation errors. I tried compile and testImplementation as well, nothing worked.
Note: I am not using TestNG for unit testing here. I am trying to build a Function Test Framework.
英文:
I am new to gradle and have rarely used maven also before. I have built a Automation Framework using TestNG and adding wrapper around TestNG. Now I want to make it as a gradle project. I am using the below content in the build.gradle.
plugins {
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
}
//mainClassName = "mainclass"
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
implementation group: 'javax.json', name: 'javax.json-api', version: '1.1.4'
implementation group: 'org.testng', name: 'testng', version: '7.7.1'
}
In this case only javax-json-api.jar is downloaded and added to the 'Projects and External Dependencies' section in Eclipse. TestNG doesn't get downloaded and Eclipse shows me the compilation errors. I tried compile and testImplementation as well, nothing worked.
Note: I am not using TestNG for unit testing here. I am trying to build a Function Test Framework.
答案1
得分: 1
我使用的是Java 8,而TestNG 7.7.1 需要Java 11或更高版本。
在我切换到TestNG 7.5之后,一切都正常运行了。
参考链接:
https://stackoverflow.com/questions/73075884/org-testng-itestlistener-has-been-compiled-by-a-more-recent-version-of-the-java
https://testng.org/doc/
英文:
I was using java 8 and testng 7.7.1 requires java 11 or higher.
It worked fine for me after I used testng 7.5.
References:
https://stackoverflow.com/questions/73075884/org-testng-itestlistener-has-been-compiled-by-a-more-recent-version-of-the-java
https://testng.org/doc/
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论