filmov
tv
How to create Deployable WAR and JAR file by Spring Boot | Convert JAR to WAR and WAR to JAR
![preview_player](https://i.ytimg.com/vi/45oINuKE2ps/sddefault.jpg)
Показать описание
#Deployable #WAR #JAR #File #Creation
Instagram: techtalk_debu
if you like my video, please subscribe to my channel and share the video
For Creating Jar :
1. Put the plugin int the POM.xml ( if you are using maven )
(build)
(plugins)
(plugin)
(artifactId)spring-boot-maven-plugin(/artifactId)
(/plugin)
(/plugins)
(/build)
By Default create JAR file in the traget folder
If you want to change the embedded Tomcat server put below in the POM.XML
(dependency)
(artifactId)spring-boot-starter-web(/artifactId)
(exclusions)
(exclusion)
(artifactId)spring-boot-starter-tomcat(/artifactId)
(/exclusion)
(/exclusions)
(/dependency)
(dependency)
(artifactId)spring-boot-starter-jetty(/artifactId)
(/dependency)
2. Creating WAR File :
(packaging)war(/packaging)
(dependency)
(artifactId)spring-boot-starter-tomcat(/artifactId)
(scope)provided(/scope)
(/dependency)
and then your main class looks like below : ( which extends the SpringBootServletInitializer class )
@SpringBootApplication
public class SecondInitilize extends SpringBootServletInitializer {
public static void main(String[] args) {
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
}
}
Thanks & Regards,
Debu Paul
Instagram: techtalk_debu
if you like my video, please subscribe to my channel and share the video
For Creating Jar :
1. Put the plugin int the POM.xml ( if you are using maven )
(build)
(plugins)
(plugin)
(artifactId)spring-boot-maven-plugin(/artifactId)
(/plugin)
(/plugins)
(/build)
By Default create JAR file in the traget folder
If you want to change the embedded Tomcat server put below in the POM.XML
(dependency)
(artifactId)spring-boot-starter-web(/artifactId)
(exclusions)
(exclusion)
(artifactId)spring-boot-starter-tomcat(/artifactId)
(/exclusion)
(/exclusions)
(/dependency)
(dependency)
(artifactId)spring-boot-starter-jetty(/artifactId)
(/dependency)
2. Creating WAR File :
(packaging)war(/packaging)
(dependency)
(artifactId)spring-boot-starter-tomcat(/artifactId)
(scope)provided(/scope)
(/dependency)
and then your main class looks like below : ( which extends the SpringBootServletInitializer class )
@SpringBootApplication
public class SecondInitilize extends SpringBootServletInitializer {
public static void main(String[] args) {
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
}
}
Thanks & Regards,
Debu Paul
Комментарии