Comments (4)
@patbaumgartner It's not clear to me what you are trying to do. The CDS_TRAINING_JAVA_TOOL_OPTIONS
environment variable can be configured on the spring-boot:build-image
goal and passed to the Paketo Spring Boot buildpack. It should have no effect on the spring-boot:run
goal, so I don't see how it could interfere with setting spring-boot.run.arguments
on spring-boot:run
.
Can you provide a more complete example of your pom.xml
, the mvn
commands you are running, and the behavior you expect?
from spring-boot.
my main goal was to use App CDS with the spring-boot-maven plugin as it is described in the Buildpacks documentation. I realized that the parameter CDS_TRAINING_JAVA_TOOL_OPTIONS gets passed as JAVA_TOOL_OPTIONS successfully and was ignored. So I tried to find out where the issue might be.
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>process-aot</id>
<goals>
<goal>process-aot</goal>
</goals>
</execution>
</executions>
<configuration>
<image>
<env>
<BP_SPRING_AOT_ENABLED>true</BP_SPRING_AOT_ENABLED>
<BP_JVM_CDS_ENABLED>true</BP_JVM_CDS_ENABLED>
<CDS_TRAINING_JAVA_TOOL_OPTIONS>-Dtelegrambots.enabled=false</CDS_TRAINING_JAVA_TOOL_OPTIONS>
</env>
</image>
</configuration>
</plugin>
Then I tried to run the app with java -Dtelegrambots.enabled=true -jar my.jar
and it worked. Next step was the maven plugin which I got wrong above. It should have been mvn spring-boot:run -Dspring-boot.run.arguments="-Dreproducer.enabled=true"
which passes the args to the app.
After that I realized that when adding -Dspring.context.exit=onRefresh
my enabling property gets ignored. It doesn't matter if I do it via maven, buildpacks or java -jar.
I remember that I saw somewhere @sdeleuze used spring.flyway.enabled=false
of FlywayAutoConfiguration for a training run but since the property gets ignored, it would not work as expected, which means to not creating a DB connection and migrating the data.
Since this is a pretty new feature, there is not much documentation and answers on SO. I hope you could follow my thoughts.
Best,
Patrick
from spring-boot.
spring-boot.run.arguments
are for arguments to the main class. I think jvmArguments
is what you're looking for?
from spring-boot.
FYI I did a quick test on aarch64 with the buildpacks branch of petclinic-efficient-container. If I remove spring.data.jdbc.dialect=postgresql
from application.properties
, the application training run fails as expected because it tries to connect to the database when building the container.
If I bring it back in the Spring Boot Maven configuration, it works again:
<configuration>
<image>
<env>
<BP_SPRING_AOT_ENABLED>true</BP_SPRING_AOT_ENABLED>
<BP_JVM_CDS_ENABLED>true</BP_JVM_CDS_ENABLED>
<CDS_TRAINING_JAVA_TOOL_OPTIONS>-Dspring.data.jdbc.dialect=postgresql</CDS_TRAINING_JAVA_TOOL_OPTIONS>
</env>
</image>
</configuration>
I did another test on x86 without the Spring Framework version customization, builder and image customization, it works as well. So the feature seems to work as expected with Buildacks. For Spring Boot run, the configuration is done differently as pointed out by @scottfrederick and @mhalbritter.
from spring-boot.
Related Issues (20)
- Image building requires builder to specify a stack
- spring-boot-starter-parent:3.3.0 java 22 threads.virtual NOT WORKING HOT 7
- Switch to Tomcat's new setter to set the maximum queue size
- java.lang.NoClassDefFoundError: org.apache.commons.collections.FastHashMap HOT 1
- Upgrade to Hibernate 6.4.9.Final
- Upgrade to Infinispan 14.0.29.Final
- Service connection for bitnami mongodb fails to connect
- Use organization level CODE_OF_CONDUCT
- `:` characters are removed from `application.yaml` keys in mapped values when using `@ConfigurationProperties` HOT 3
- MongoHealthIndicator not compliant with Mongo stable API with strict setting HOT 3
- System.exit(SpringApplication.exit(ctx, () -> 42)); does not reliable exit with status 42 HOT 3
- Upgrade from 3.2.5 to 3.2.6 or 3.3.0 throws AoP Exception on startup HOT 1
- MongoHealthIndicator not compliant with Mongo stable API with strict setting
- Use organization level CODE_OF_CONDUCT
- OpenTelemetryMetricsContainerConnectionDetailsFactoryIntegrationTests is flaky when running locally HOT 3
- Spring Boot remote restart with devtools causes 'factory already defined' Tomcat error when running with 'java -jar'
- Tests in DelegatingFilterProxyRegistrationBeanTests are non idempotent
- Git instant properties cannot be coerced following git-commit-id Maven plugin upgrade HOT 2
- Unable to start Redis with Spring Actuator HOT 2
- Document more precisely how a Container's Docker image name is used to find the matching service connection HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-boot.