Skip to content

dsyer/spring-boot-aot

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

Native image generation works:

$ mvn clean install
$ CP=`java -jar target/*.jar --thin.classpath --thin.profile=graal`
$ native-image -H:Name=target/app -H:IncludeResources='META-INF/spring.factories|org/springframework/boot/logging/.*' -H:ReflectionConfigurationFiles=app.json --report-unsupported-elements-at-runtime -cp $CP com.acme.SampleApplication
$ ./target/app -Dorg.springframework.boot.logging.LoggingSystem=org.springframework.boot.logging.java.JavaLoggingSystem
11:09:17.864 [main] DEBUG org.springframework.boot.context.logging.ClasspathLoggingApplicationListener - Application started with classpath: unknown

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                        

11:09:17.865 [main] INFO com.acme.SampleConfiguration - Initializing
...
11:09:17.866 [main] INFO com.acme.SampleConfiguration - Creating: com.acme.Bar@7f1a6ad164a8
11:09:17.866 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory'
11:09:17.866 [main] INFO org.springframework.boot.SpringApplication - Started application in 0.008 seconds (JVM running for 0.009)
11:09:17.866 [main] INFO com.acme.SampleConfiguration - Bar: com.acme.Bar@7f1a6ad164a8

Notes:

The LogbackLoggingSystem doesn't work because of a Graal bug.

The thin-graal.properties includes dependencies.tomcat=org.springframework.boot:spring-boot-starter-tomcat because of a Spring Boot issue, even though this is not a web application. You would have to include it in a Netty webflux app as well to work around the issue.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages