Spring boot war

I try to use the runnable JAR during development, but I need a WAR to deploy.

I followed this article about converting from JAR to WAR Spring Boot Gradle build.

However, right now, every time I switch assemblies from one to another, I have to comment and uncomment specific parts of the assembly file.

Is there a cleaner way to handle JAR and WAR?

+4
source share
2 answers

The war that is about to be built for deployment (that is, if you added the spring-boot maven plugin) will be the same as the jar file.

java -jar mywar.war

, , , .

+5

pom gradle . , pom ( jar, ) maven, gradle.

, pom.xml build.gradle jar, pomWar.xml buildWar.gradle ,

[ maven] $ mvn clean install

[ gradle] $ gradle bootRepackage

[ maven] $ mvn -f pomWar.xml clean install

[ gradle] $ gradle -b buildWar.gradle clean test bootRepackage

. , , spring, , , ,

0

All Articles