native-build-tools icon indicating copy to clipboard operation
native-build-tools copied to clipboard

With autodetection enabled, `generateTestResourceConfig` should look at processed test resources only

Open alvarosanchez opened this issue 1 year ago • 0 comments

What happens currently, given that resources.autodetection.enabled is set, is the following:

generateResourceConfig

  • ✅ Detects resources in target/classes.
[INFO] [INFO] --- native:0.9.28:generateResourceConfig (default-generateResourceConfig) @ package-native-image ---
[INFO] [INFO] Detected resources for /Users/alvaro/Dev/micronaut-projects/micronaut-maven-plugin/target/it/package-native-image/target/classes are [logback.xml, application.yml]
[INFO] [INFO] Resources configuration written into /Users/alvaro/Dev/micronaut-projects/micronaut-maven-plugin/target/it/package-native-image/target/native/generated/generateResourceConfig/resource-config.json

generateTestResourceConfig

  • :x: Detects resources in target/classes. It should be in target/test-classes.
  • :x: Detects resources in src/test/resources. This shouldn't be attempted since a) those are unprocessed; and b) processed test resources will already be in target/test-classes.
[INFO] [INFO] --- native:0.9.28:generateTestResourceConfig (default-generateTestResourceConfig) @ package-native-image ---
[INFO] [INFO] Detected resources for /Users/alvaro/Dev/micronaut-projects/micronaut-maven-plugin/target/it/package-native-image/target/classes are [logback.xml, application.yml]
[INFO] [INFO] Detected resources for /Users/alvaro/Dev/micronaut-projects/micronaut-maven-plugin/target/it/package-native-image/src/test/resources are [application-test.yml]
[INFO] [INFO] Resources configuration written into /Users/alvaro/Dev/micronaut-projects/micronaut-maven-plugin/target/it/package-native-image/target/native/generated/generateTestResourceConfig/resource-config.json

alvarosanchez avatar Jan 31 '24 11:01 alvarosanchez