Open sendev1 opened 4 years ago
Hm might this be because of using bootJar
instead of jar
? I'm trying out this plugin right now and I get the same problem.
Using gradle bootJar
my classes are package inside of BOOT-INF/classes
while with a simple jar
they are package in root of the jar file.
Hi,
I have the same problem as @sendev1. When I try to build my project with ./gradlew clean build nativeImage
i get this error message: Error: Main entry point class 'de.hello.Application.' not found.
.
Here is my build.gradle
plugins {
id 'org.springframework.boot' version '2.2.9.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
id 'application'
id 'com.palantir.graal' version '0.7.1-20-g113a84d'
}
apply plugin: 'java'
apply plugin: 'application'
group = 'de.hello'
version = '0.0.1'
sourceCompatibility = '8'
mainClassName = 'de.hello.Application'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'tel.schich:javacan:2.1.0'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
test {
useJUnitPlatform()
}
graal {
mainClass 'de.hello.Application'
graalVersion '20.1.0'
outputName 'hello'
option '-H:+ReportExceptionStackTraces'
}
Hm might this be because of using
bootJar
instead ofjar
? I'm trying out this plugin right now and I get the same problem. Usinggradle bootJar
my classes are package inside ofBOOT-INF/classes
while with a simplejar
they are package in root of the jar file.
How can I use the jar
task instead of bootJar
? @maffelbaffel can you please post the workaround?
What happened?
I have a simple spring boot application which is running fine in spring boot mode in Intellij or as a jar. Please see below for the logs
But when I try to create native image using plug in I see following error
Error: Image build request failed with exit status 1
As you can see from the spring boot jar version log the main class is under package com.palantir.test.Main . Not sure why the plugin is complaining that its not able to find main class.
Here is the build.gradle entry
What did you want to happen?
native image should be created for spring boot version 2.3.1.RELEASE or any spring boot version supported by Graal