我有一个 groovy 应用程序,我想用 gradle 打包到可执行 jar 中。问题是当 jar 完成时我有错误:无法找到或加载主类。这是我的 build.gradle:
group 'com.demo'
version '1.0-SNAPSHOT'
apply plugin: 'groovy'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin:'application'
mainClassName = 'com.demo.App'
buildscript {
repositories {
mavenCentral()
}
dependencies {}
}
repositories {
mavenCentral()
}
// java version dependency
sourceCompatibility = 1.8
targetCompatibility = 1.8
jar {
baseName = 'cim-configurator'
version = '0.1.0'
manifest {
attributes("Build-Time": new Date().format("yyyy-MM-dd HH:mm:ss"),
"Build-Jdk": System.getProperty("java.version"),
"Built-By": System.getProperty("user.name"),
"Created-By": "Gradle",
"Main-Class": "com.demo.App"
)
}
}
这是文件层次结构:
com.demo
ActiveMq
App
Database
Rbac
Run.groovy
Service
一只斗牛犬
POPMUISE
相关分类