Skip to content

spencergibb/spring-native

 
 

Repository files navigation

Build Status 0.8.5 documentation

Spring Native provides an incubating support for compiling Spring applications to native executables using GraalVM native-image compiler, in order to provide a native deployment option designed to be packaged in lightweight containers. In practice, the target is to support your Spring application (typically a Spring Boot one), unmodified, on this new platform.

Watch The Path Towards Spring Boot Native Applications SpringOne 2020 talk recording for more details: The Path Towards Spring Boot Native Applications

It is mainly composed of:

  • spring-native: this module contains the runtime dependency required for running Spring native like the substitutions.

  • spring-native-configuration: this module contains configuration hints for Spring classes, including various Spring Boot auto-configurations.

  • spring-native-samples: contains various samples that demonstrate the feature usage and are used as integration tests.

  • spring-native-docs: contains the asciidoc documentation sources.

  • spring-native-tools: tools used for reviewing image building configuration and output.

  • spring-native-parent: Maven parent pom with preconfigured dependency and plugin management.

  • spring-aot: this module contains the AOT transformation infrastructure common to Maven and Gradle plugins.

  • spring-aot-maven-plugin: this module contains the Maven plugin that invokes AOT transformations.

Scope and status

This project status is alpha, which means that we are currently mainly working on the software design and on supporting the features of the current samples (work in progress). Supporting a wider range of Spring Boot applications, as well as optimizing efficiency (image size, memory consumption) and performances will happen as a second step.

Spring team collaborates with the GraalVM native team by raising issues in their bug tracker, to improve the production-readiness of native-images. These bugs on the GraalVM issue tracker are identified by the spring label.

Some changes incubated here are moved directly to Spring Framework and Spring Boot projects.

Quick start

For detailed information and walkthroughs of applying the techniques to your project, please see the documentation.

Artifacts

The latest 0.8.5 release supports GraalVM 20.3.0 and Spring Boot 2.4.1.

Play with the samples

  • Download and extract sources from the latest release.

  • Go into the samples folder and pick one (e.g. cd spring-native-samples/commandlinerunner)

  • Run ./build.sh which will run a maven build, then a native image compile, then test the result.

build.sh runs the compile.sh script and in that compile script you can see the invocation of the native-image command. The other samples follow a similar model. For more details on the samples see the samples documentation.

Contributing

This project is in the spring-projects-experimental org indicating it is not as mature as other Spring projects. Contributions are welcome (maybe read the extension guide if thinking about extending it to support your project). However, please recognize we aren’t at the polishing javadoc stage and whilst pre 1.0 there may be heavy evolution of APIs.

Baseline

The development version on master is currently based on GraalVM 20.1.0 and Spring Boot 2.4.3. Mac, Linux and Windows are supported.

About

Spring Native for GraalVM

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages

  • Java 93.1%
  • Shell 2.6%
  • HTML 2.4%
  • Less 1.1%
  • Kotlin 0.6%
  • Dockerfile 0.2%