Gradle is not my cup of tea so please be understanding if my question is simple.
I have a Java test class with a main method so it can be executed when the program launches. The problem is that Java does not find this class even though it is in the JAR file!
Please see below my Gradle task to build this JAR.
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
task testJar(type: ShadowJar) {
classifier = 'tests'
from sourceSets.test.output
configurations = [project.configurations.testRuntime]
manifest {
attributes "Main-Class": "com.irex.m3.dms.signage.vendor.aiss.api.AISSTest"
}
}
I get the following when I attempt to run the JAR.
C:\TFS\iRex\m3Ent\dev\main\src\dmsi\aiss\build\libs>java -jar aiss-2.0-tests.jar
Error: Could not find or load main class com.irex.m3.dms.signage.vendor.aiss.api.AISSTest
Finally, please see below a screenshot showing that the class that cannot be found is actually in the JAR.
Any help is greatly appreciated.
Patrick
Aucun commentaire:
Enregistrer un commentaire