Hallo zusammen ich habe ein molti modul spring boot Project und möchte daraus eine ausführbare jar bauen.
Hier meine Ordner bzw Modul Struktur :
[CODE title="root - settings.gradle"]rootProject.name = 'calendar'
include 'calendar-commons'
include 'calendar-user'
include 'calendar-app'
include 'calendar-event'
include 'calendar-event:custom-calendar-event'
include 'calendar-event:sams-calendar-event'
include 'calendar-importer'
include 'calendar-importer:csv-importer'
include 'calendar-importer:utils'[/CODE]
[CODE title="root - build.gradle"]plugins {
id 'java'
id 'application'
id 'org.springframework.boot' version '2.4.3'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
}
application {
mainModule="calendar-app"
mainClass = "calendar.app.App"
}
allprojects {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
repositories {
mavenCentral()
}
}
subprojects {
version = '1.0.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa',
'org.projectlombok:lombok:1.18.18',
'org.apache.commons:commons-lang3:3.12.0'
annotationProcessor 'org.projectlombok:lombok'
compileOnly 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testAnnotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
}
test {
useJUnitPlatform()
}
}[/CODE]
in allen module build.gradle
Wenn ich nun
ausführe erhalte ich folgenden Fehler :
Da ich mich mit gradle noch nicht so gut auskenn benötige ich an dieser stelle etwas hilfe
Hier meine Ordner bzw Modul Struktur :
[CODE title="root - settings.gradle"]rootProject.name = 'calendar'
include 'calendar-commons'
include 'calendar-user'
include 'calendar-app'
include 'calendar-event'
include 'calendar-event:custom-calendar-event'
include 'calendar-event:sams-calendar-event'
include 'calendar-importer'
include 'calendar-importer:csv-importer'
include 'calendar-importer:utils'[/CODE]
[CODE title="root - build.gradle"]plugins {
id 'java'
id 'application'
id 'org.springframework.boot' version '2.4.3'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
}
application {
mainModule="calendar-app"
mainClass = "calendar.app.App"
}
allprojects {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
repositories {
mavenCentral()
}
}
subprojects {
version = '1.0.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa',
'org.projectlombok:lombok:1.18.18',
'org.apache.commons:commons-lang3:3.12.0'
annotationProcessor 'org.projectlombok:lombok'
compileOnly 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testAnnotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
}
test {
useJUnitPlatform()
}
}[/CODE]
in allen module build.gradle
Java:
bootJar {
enabled = false
}
jar {
enabled = true
....
}
Wenn ich nun
Java:
gradlew clean build
Code:
* What went wrong:
Execution failed for task ':calendar-event:bootJar'.
> Error while evaluating property 'mainClass' of task ':calendar-event:bootJar'
> Failed to calculate the value of task ':calendar-event:bootJar' property 'mainClass'.
> Main class name has not been configured and it could not be resolved
Da ich mich mit gradle noch nicht so gut auskenn benötige ich an dieser stelle etwas hilfe