In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces how to use the Maven plug-in in Spring Boot, the content is very detailed, interested friends can refer to, hope to be helpful to you.
Include the plug-in
To use the Spring Boot Maven plug-in, simply include the corresponding XML in the plugins section of your pom.xml:
4.0.0 org.springframework.boot spring-boot-maven-plugin 1.4.1.RELEASE repackage
This configuration repackages a jar or war during the package phase of the Maven lifecycle. The following example shows both the repackaged jar and the original jar under the target directory:
$mvn package$ ls target/*.jartarget/myproject-1.0.0.jar target/myproject-1.0.0.jar.original
If you don't include something like the one above, you can run the plug-in yourself (but only if the package target is also used), for example:
$mvn package spring-boot:repackage$ ls target/*.jartarget/myproject-1.0.0.jar target/myproject-1.0.0.jar.original
If you use a milestone or snapshot version, you also need to add the correct pluginRepository element:
Spring-snapshots http://repo.spring.io/snapshot spring-milestones http://repo.spring.io/milestone packages executable jar and war files
Once spring-boot-maven-plugin is included in your pom.xml, Spring Boot will automatically attempt to rewrite archives with spring-boot:repackage targets so that they can be executed. To build a jar or war, you should configure your project with regular packaging elements:
Jar
The resulting archive is enhanced by Spring Boot during the package phase. The main class you want to start can be done either by specifying a configuration option or by adding a Main-Class property to the manifest. If you do not specify a main class, the plug-in will search for classes with public static void main (String [] args) methods.
To build and run a project's artifact, you can enter the following command:
$mvn package$ java-jar target/mymodule-0.0.1-SNAPSHOT.jar
To build a war file that can be executed and deployed to an external container, you need to mark the embedded container dependency as "provided", for example:
War org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-tomcat provided on how to use the Maven plug-in in Spring Boot to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.