try to made devtools work, add some spring-graalvm-native properties
This commit is contained in:
parent
ee313e09bd
commit
1484b129b9
@ -21,6 +21,7 @@ RUN ./mvnw -Pgraal compile
|
|||||||
# generate graalvm image into another layer
|
# generate graalvm image into another layer
|
||||||
RUN ./mvnw -Pgraal package
|
RUN ./mvnw -Pgraal package
|
||||||
|
|
||||||
|
#FROM debian:buster
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY --from=builder /build/target/wikiProject /wikiproject
|
COPY --from=builder /build/target/wikiProject /wikiproject
|
||||||
COPY --from=builder /tmp /tmp
|
COPY --from=builder /tmp /tmp
|
||||||
|
7
issue.md
7
issue.md
@ -80,3 +80,10 @@ make: *** [Makefile:22: docker-graal-run] Error 1
|
|||||||
Warning: class initialization of class org.springframework.boot.validation.MessageInterpolatorFactory failed with exception java.lang.NoClassDefFoundError: javax/validation/ValidationException. This class will be initialized at run time because option --allow-incomplete-classpath is used for image building. Use the option --initialize-at-run-time=org.springframework.boot.validation.MessageInterpolatorFactory to explicitly request delayed initialization of this class.
|
Warning: class initialization of class org.springframework.boot.validation.MessageInterpolatorFactory failed with exception java.lang.NoClassDefFoundError: javax/validation/ValidationException. This class will be initialized at run time because option --allow-incomplete-classpath is used for image building. Use the option --initialize-at-run-time=org.springframework.boot.validation.MessageInterpolatorFactory to explicitly request delayed initialization of this class.
|
||||||
Number of types dynamically registered for reflective access: #2024
|
Number of types dynamically registered for reflective access: #2024
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## error class not found
|
||||||
|
|
||||||
|
```
|
||||||
|
WARNING: Could not resolve org.springframework.boot.devtools.logger.DevToolsLogFactory.Listener for reflection configuration.
|
||||||
|
WARNING: Could not resolve javax.validation.ValidationException for reflection configuration.
|
||||||
|
```
|
||||||
|
16
pom.xml
16
pom.xml
@ -135,19 +135,19 @@
|
|||||||
<artifactId>native-image-maven-plugin</artifactId>
|
<artifactId>native-image-maven-plugin</artifactId>
|
||||||
<version>${native-image-maven-plugin.version}</version>
|
<version>${native-image-maven-plugin.version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<!-- doc here : https://repo.spring.io/milestone/org/springframework/experimental/spring-graalvm-native-docs/0.7.1/spring-graalvm-native-docs-0.7.1.zip!/reference/index.html#options -->
|
||||||
<buildArgs>
|
<buildArgs>
|
||||||
-Dspring.graal.mode=initialization-only
|
-H:+PrintAnalysisCallTree
|
||||||
-Dspring.graal.dump-config=/tmp/computed-reflect-config.json
|
|
||||||
-Dspring.graal.verbose=true
|
|
||||||
-Dspring.graal.skip-logback=true
|
|
||||||
-Dspring.graal.remove-unused-autoconfig=true
|
|
||||||
-H:+TraceClassInitialization
|
-H:+TraceClassInitialization
|
||||||
--no-fallback
|
<!-- -H:+ReportExceptionStackTraces-->
|
||||||
|
<!-- reduce build time and memory -->
|
||||||
|
<!-- -H:+RemoveSaturatedTypeFlows-->
|
||||||
--allow-incomplete-classpath
|
--allow-incomplete-classpath
|
||||||
--report-unsupported-elements-at-runtime
|
--report-unsupported-elements-at-runtime
|
||||||
-H:+ReportExceptionStackTraces
|
--no-fallback
|
||||||
--no-server
|
--no-server
|
||||||
--initialize-at-build-time=org.springframework.boot.validation.MessageInterpolatorFactory
|
--verbose
|
||||||
|
<!-- --initialize-at-build-time=org.springframework.boot.validation.MessageInterpolatorFactory-->
|
||||||
-J-Xmx3G --static
|
-J-Xmx3G --static
|
||||||
</buildArgs>
|
</buildArgs>
|
||||||
<imageName>${project.artifactId}</imageName>
|
<imageName>${project.artifactId}</imageName>
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
Args=\
|
||||||
|
-Dspring.native.mode=feature \
|
||||||
|
-Dspring.native.verbose=true \
|
||||||
|
-Dspring.native.dump-config=/tmp/computed-reflect-config.json \
|
||||||
|
-Dspring.native.remove-unused-autoconfig=true
|
||||||
|
|
||||||
|
# -H:ReflectionConfigurationResources=${.}/reflect-config.json
|
||||||
|
# -Dspring.graal.skip-logback=true
|
@ -3,5 +3,10 @@
|
|||||||
"name": "org.springframework.boot.devtools.logger.DevToolsLogFactory.Listener",
|
"name": "org.springframework.boot.devtools.logger.DevToolsLogFactory.Listener",
|
||||||
"allDeclaredConstructors": true,
|
"allDeclaredConstructors": true,
|
||||||
"allDeclaredMethods": true
|
"allDeclaredMethods": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "javax.validation.ValidationException",
|
||||||
|
"allDeclaredConstructors": true,
|
||||||
|
"allDeclaredMethods": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user