Здравствуйте.
Написал Java класс для подключения к Hive и сделал таск для сборки
task Hive(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Gradle Jar File Example',
'Implementation-Version': version,
'Main-Class': 'ru.prometheus.nodeexporters.Hive'
}
baseName = project.name + '-Node_Exporter'
// from('src/main/java') {
// include 'resources/*'
// }
from {
configurations.runtime.collect {
it.isDirectory() ? it : zipTree(it)
}
}
with jar
}
запустил сборку
12:55:46: Executing task 'Hive'...
> Task :Hive:compileJava
Note: C:\Servers\Repository\PrometheusNodeExporters\Hive\src\main\java\ru\prometheus\nodeexporters\Hive.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Servers\Repository\PrometheusNodeExporters\Hive\src\main\java\ru\prometheus\nodeexporters\Hive.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
> Task :Hive:processResources
> Task :Hive:classes
> Task :Hive:Hive
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 26s
3 actionable tasks: 3 executed
12:56:13: Task execution finished 'Hive'.
в результате все классы на месте в том числе и main
НО при запуске Java машина не может найти главный класс
c:\Servers\Repository\PrometheusNodeExporters\Hive\build\libs>java -jar Hive-Nod
e_Exporter-1.0-SNAPSHOT.jar
Error: Could not find or load main class ru.prometheus.nodeexporters.Hive
проект на
github
Как решить эту проблему?