I have this plugin config in my pomn:
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>
-Djavax.net.ssl.trustStore=${project.build.outputDirectory}/keystore.jks
-Djavax.net.ssl.trustStorePassword=ue90D3v
-Djavax.net.ssl.keyStore=${project.build.outputDirectory}/keystore.jks
-Djavax.net.ssl.keyStorePassword=ue90D3v
</jvmArguments>
</configuration>
</plugin>
</plugins>
So I can run app perfectly by mvn spring-boot:run. But what if I want to override arguments, for example "javax.net.ssl.trustStore". I expect this command works:
mvn spring-boot:run -Djavax.net.ssl.trustStore=<other_location>
But it doesn't. Also I tried this and not working :
mvn -Dspring-boot.run.jvmArguments="-Djavax.net.ssl.trustStore=other_location" spring-boot:run
Also it would be a solution if I can set JAVA_OPTS in pom.
facing the same problem, you can do this:
<properties>
<!-- defined here if you don't use -Dspring-boot.run.jvmArguments-->
<spring-boot.run.jvmArguments></spring-boot.run.jvmArguments>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>
-Djavax.net.ssl.trustStore=${project.build.outputDirectory}/keystore.jks
-Djavax.net.ssl.trustStorePassword=ue90D3v
-Djavax.net.ssl.keyStore=${project.build.outputDirectory}/keystore.jks
-Djavax.net.ssl.keyStorePassword=ue90D3v
${spring-boot.run.jvmArguments}
</jvmArguments>
</configuration>
</plugin>
</plugins>
</build>
and starting you app with:
mvn -Dspring-boot.run.jvmArguments="-Djavax.net.ssl.trustStore=other_location" spring-boot:run
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With