Skip to content

Maven plugin with helper methods for generating native configuration

License

Notifications You must be signed in to change notification settings

fugerit-org/native-helper-maven-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

native-helper-maven-plugin

Maven plugin with helper methods for generating native configuration

Keep a Changelog v1.1.0 badge license
code of conduct Maven Central
Quality Gate Status
Coverage

Java runtime version Java build version Apache Maven Fugerit Github Project Conventions

This maven plugin allows generation of graalvm metadata using the native-helper-graalvm

1. mojo 'generate'

Write a native-helper-config.yaml configuration file for the project. (configuration reference here)

<plugin>
    <groupId>org.fugerit.java</groupId>
    <artifactId>native-helper-maven-plugin</artifactId>
    <version>${native-helper-maven-plugin-version}</version>
    <executions>
        <execution>
            <id>generate-native-configuration</id>
            <phase>prepare-package</phase>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
                <createParentDirectory>true</createParentDirectory>
                <nativeHelperConfigPath>${project.basedir}/src/main/config/native-helper-config.yaml</nativeHelperConfigPath>
                <reflectConfigJsonOutputPath>${project.build.directory}/generated-resources/reflect-config-demo.json</reflectConfigJsonOutputPath>
                <warnOnError>false</warnOnError>
            </configuration>
        </execution>
    </executions>
</plugin>

mojo 'generate' configuration reference

name default required type description
nativeHelperConfigPath none true string Path to native-helper-config.yaml configuration file
reflectConfigJsonOutputPath none false string generation path for reflect-config.json file
createParentDirectory false false boolean if set to true will create reflectConfigJsonOutputPath parent folder
warnOnError false false boolean if set to true exception will be logged instead of generating a build error

2. mojo 'merge'

<plugin>
    <groupId>org.fugerit.java</groupId>
    <artifactId>native-helper-maven-plugin</artifactId>
    <version>${native-helper-maven-plugin-version}</version>
    <executions>
        <execution>
            <id>merge-native-configuration</id>
            <phase>prepare-package</phase>
            <goals>
                <goal>merge</goal>
            </goals>
            <configuration>
                <reflectConfigJsonFiles>
                    <reflectConfigJsonFile>${project.build.directory}/generated-resources/reflect-config-demo.json</reflectConfigJsonFile>
                    <reflectConfigJsonFile>${project.basedir}/src/main/config/reflect-config-nhg.json</reflectConfigJsonFile>
                </reflectConfigJsonFiles>
                <reflectConfigJsonOutputPath>${project.build.outputDirectory}/META-INF/native-image/reflect-config.json</reflectConfigJsonOutputPath>
                <createParentDirectory>true</createParentDirectory>
                <warnOnError>true</warnOnError>
            </configuration>
        </execution>
    </executions>
</plugin>

mojo 'merge' configuration reference

name default required type description
reflectConfigJsonFiles.reflectConfigJsonFile none true string List of reflect-config.json files to merge
reflectConfigJsonOutputPath none true string generation path for reflect-config.json file
createParentDirectory false false boolean if set to true will create reflectConfigJsonOutputPath parent folder
warnOnError false false boolean if set to true exception will be logged instead of generating a build error

3. Demo project

Here is a simple demo project

About

Maven plugin with helper methods for generating native configuration

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages