Skip to content

Latest commit

 

History

History
75 lines (66 loc) · 1.97 KB

SETUP_MAVEN.md

File metadata and controls

75 lines (66 loc) · 1.97 KB

Steeps for GraalVM support

  1. Add graalVM dependency and annotation processor
<dependencies>
    <dependency>
        <groupId>io.flamingock</groupId>
        <artifactId>mongodb-sync-v4-driver</artifactId>
        <version>${flamingock.version}</version>
    </dependency>

    <dependency>
        <groupId>io.flamingock</groupId>
        <artifactId>flamingock-core</artifactId>
        <version>${flamingock.version}</version>
    </dependency>

    <dependency>
        <groupId>io.flamingock</groupId>
        <artifactId>flamingock-graalvm</artifactId>
        <version>${flamingock.version}</version>
    </dependency>
</dependencies>
  1. Add annotation processor
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.11.0</version>
            <configuration>
                <annotationProcessorPaths>
                    <path>
                        <groupId>io.flamingock</groupId>
                        <artifactId>flamingock-core</artifactId>
                        <version>${flamingock.version}</version>
                    </path>
                </annotationProcessorPaths>
            </configuration>
        </plugin>
    </plugins>
</build>
  1. Add the flamingock configuration file to resource-config.json
{
  "resources": {
    "includes": [
      {
        "pattern": "META-INF/flamingock-metadata.json"
      }
    ]
  }
}
  1. Build application
./mvnw clean package
  1. Create native image
native-image --no-fallback --features=io.flamingock.graalvm.RegistrationFeature -H:ResourceConfigurationFiles=resource-config.json -H:+ReportExceptionStackTraces --initialize-at-build-time=org.slf4j.simple.SimpleLogger,org.slf4j.LoggerFactory,org.slf4j.impl.StaticLoggerBinder -jar target/flamingock-graalvm-example-0.0.1-SNAPSHOT.jar
  1. Run native image
./flamingock-graalvm-example-1.0-SNAPSHOT