Skip to content

Conversation

@ljluestc
Copy link

Changes Made

Core Implementation:

  • Created 5 new build items to carry parsed native-image metadata through the Quarkus build process:

    • NativeImagePropertiesBuildItem - for parsed command-line arguments from native-image.properties
    • NativeImageReflectConfigBuildItem - for reflection configuration JSON
    • NativeImageResourceConfigBuildItem - for resource configuration JSON
    • NativeImageJniConfigBuildItem - for JNI configuration JSON
    • NativeImageProxyConfigBuildItem - for proxy configuration JSON
  • Implemented NativeImageMetadataParserStep - a new build step that:

    • Scans all dependencies for META-INF/native-image files
    • Parses native-image.properties files with complex argument handling (including quoted strings)
    • Validates JSON configuration files
    • Produces build items containing the parsed metadata
  • Updated NativeImageBuildStep and NativeImageInvokerInfo.Builder to consume parsed metadata and inject arguments directly into the native-image command line

Testing:

  • Added comprehensive unit tests for argument parsing logic and JSON validation
  • Created integration test module native-image-metadata-parser that verifies:
    • JVM functionality (resource bundle access with different locales)
    • Native image compilation success with metadata injection
    • End-to-end functionality

Key Features:

  • Automatic Discovery: Scans all dependency JARs for native-image metadata
  • Smart Parsing: Correctly handles complex command-line arguments including quoted strings and spaces
  • JSON Validation: Ensures configuration files contain valid JSON structures
  • Error Handling: Proper logging and graceful handling of malformed metadata
  • Backwards Compatibility: Maintains existing exclusion mechanisms as fallback

@geoand
Copy link
Contributor

geoand commented Nov 24, 2025

Thanks for the contribution.

Can you elaborate on why this is useful for Quarkus?

@geoand geoand added the triage/needs-feedback We are waiting for feedback. label Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core triage/needs-feedback We are waiting for feedback.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants