Interface NativeConfig.ResourcesConfig

  • Enclosing interface:
    NativeConfig

    public static interface NativeConfig.ResourcesConfig
    • Method Detail

      • includes

        Optional<List<String>> includes()
        A comma separated list of globs to match resource paths that should be added to the native image.

        Use slash (/) as a path separator on all platforms. Globs must not start with slash.

        By default, no resources are included.

        Example: Given that you have src/main/resources/ignored.png and src/main/resources/foo/selected.png in your source tree and one of your dependency JARs contains bar/some.txt file, with the following configuration

         quarkus.native.resources.includes = foo/**,bar/**/*.txt
         
        the files src/main/resources/foo/selected.png and bar/some.txt will be included in the native image, while src/main/resources/ignored.png will not be included.

        Supported glob features

        Feature Description
        * Matches a (possibly empty) sequence of characters that does not contain slash (/)
        ** Matches a (possibly empty) sequence of characters that may contain slash (/)
        ? Matches one character, but not slash
        [abc] Matches one character given in the bracket, but not slash
        [a-z] Matches one character from the range given in the bracket, but not slash
        [!abc] Matches one character not named in the bracket; does not match slash
        [a-z] Matches one character outside the range given in the bracket; does not match slash
        {one,two,three} Matches any of the alternating tokens separated by comma; the tokens may contain wildcards, nested alternations and ranges
        \ The escape character

        Note that there are three levels of escaping when passing this option via application.properties:

        1. application.properties parser
        2. MicroProfile Config list converter that splits the comma separated list
        3. Glob parser
        All three levels use backslash (\) as the escaping character. So you need to use an appropriate number of backslashes depending on which level you want to escape.

        Note that Quarkus extensions typically include the resources they require by themselves. This option is useful in situations when the built-in functionality is not sufficient.

      • excludes

        Optional<List<String>> excludes()
        A comma separated list of globs to match resource paths that should not be added to the native image.

        Use slash (/) as a path separator on all platforms. Globs must not start with slash.

        Please refer to includes() for details about the glob syntax.

        By default, no resources are excluded.

        Example: Given that you have src/main/resources/red.png and src/main/resources/foo/green.png in your source tree and one of your dependency JARs contains bar/blue.png file, with the following configuration

         quarkus.native.resources.includes = **/*.png
         quarkus.native.resources.excludes = foo/**,**/green.png
         
        the resource red.png will be available in the native image while the resources foo/green.png and bar/blue.png will not be available in the native image.