-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: avoid unregistered reflective and resource accesses
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
core/deployment/src/main/java/io/quarkus/deployment/QuarkusProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.quarkus.deployment; | ||
|
||
import static io.smallrye.config.SmallRyeConfigBuilder.META_INF_MICROPROFILE_CONFIG_PROPERTIES; | ||
|
||
import io.quarkus.deployment.annotations.BuildProducer; | ||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem; | ||
import io.quarkus.deployment.builditem.nativeimage.ReflectiveMethodBuildItem; | ||
|
||
public class QuarkusProcessor { | ||
|
||
@BuildStep | ||
ReflectiveMethodBuildItem registerReflectiveMethods() { | ||
// Called reflectively when generating quarkus.uuid | ||
return new ReflectiveMethodBuildItem("sun.security.provider.NativePRNG", "<init>", | ||
java.security.SecureRandomParameters.class); | ||
} | ||
|
||
@BuildStep | ||
void registerNativeImageResources(BuildProducer<NativeImageResourceBuildItem> resources) { | ||
// Accessed by io.quarkus.runtime.configuration.ApplicationPropertiesConfigSourceLoader.InClassPath.getConfigSources | ||
resources.produce(new NativeImageResourceBuildItem("application.properties")); | ||
// Accessed by io.smallrye.config.SmallRyeConfigBuilder.getDefaultSources | ||
resources.produce(new NativeImageResourceBuildItem(META_INF_MICROPROFILE_CONFIG_PROPERTIES)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters