Spring-boot: run works but java -jar fails

0

I'm having a problem running java -jar.

The application is an integration WS (exposes an endpoint whose operations call a third-party WS). The application worked correctly with http, but when the third party added its own certificate and forced the use of https, it stopped working.

I have created the jks, and I have managed to generate the third-party wsdl classes. The application compiles and executes "mvn spring-boot: run -Djavax.net.ssl.trustStore = MiJks.jks" works correctly. If on the other hand I use "java -jar Miapp.jar -Djavax.net.ssl.trustStore = MiJks.jks", it is not able to create the beans of the services of the 3rd.

To generate the wsdl code of the 3rd, I use jaxws-maven-plugin from codehaus.

This is the definition of the bean within the application-context:

                                                                                                   

What's wrong? What's the difference between running java via maven and running the java directly?

Thanks in advance,

    
asked by Rachel 28.05.2018 в 09:51
source

2 answers

0

Finally it has been solved using the -D option before -jar in the execution of the java command.

Thanks for the reply Raúl García

    
answered by 29.05.2018 / 09:29
source
0

Try entering the following command in the maven run:

  

mvn package spring-boot: run -D javax.net.ssl.trustStore = MiJks.jks

This command compiles and packages all the dependencies of the code in the .jar, then try to start the program from the .jar using the java command that you used before, if that does not fix it I think the problem is going to be that global variable that injectas ...

    
answered by 28.05.2018 в 10:39