MAVEN builds Spring boot project manually

Source: Internet
Author: User
Tags naming convention

1. Create a new, empty Maven project.

2, modify Pom.xml:

Add spring Boot's parent dependency (spring-boot-starter-parent), which is a special starter to provide the relevant MAVEN default dependencies-such a project is the Spring boot project. Default dependency, which is version default, some common dependencies can be removed <version> tags. As to which jar packages the spring boot is dependent on, and how much the version defaults to, see the \org\springframework\boot\spring-boot-dependencies\ directory in the local repository (if available locally) Spring-boot-dependencies.pom file.

<Projectxmlns= "http://maven.apache.org/POM/4.0.0"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"xsi:schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">    <modelversion>4.0.0</modelversion>    <groupId>com.qfedu</groupId>    <Artifactid>Springboot</Artifactid>    <version>1.0</version>    <Parent>        <groupId>Org.springframework.boot</groupId>        <Artifactid>Spring-boot-starter-parent</Artifactid>        <version>2.0.0.m2</version>        <RelativePath/>    </Parent>    <Build>        <Plugins>            <!--Spring Boot's compile plugin -            <plugin>                <groupId>Org.springframework.boot</groupId>                <Artifactid>Spring-boot-maven-plugin</Artifactid>            </plugin>        </Plugins>    </Build>    <!--The milestone version is used here. If you use the official version, you do not need the following configuration -    <repositories>        <Repository>            <ID>Spring-snapshots</ID>            <name>Spring Snapshots</name>            <URL>Https://repo.spring.io/snapshot</URL>            <Snapshots>                <enabled>True</enabled>            </Snapshots>        </Repository>        <Repository>            <ID>Spring-milestones</ID>            <name>Spring Milestones</name>            <URL>Https://repo.spring.io/milestone</URL>            <Snapshots>                <enabled>False</enabled>            </Snapshots>        </Repository>    </repositories>    <pluginrepositories>        <pluginrepository>            <ID>Spring-snapshots</ID>            <name>Spring Snapshots</name>            <URL>Https://repo.spring.io/snapshot</URL>            <Snapshots>                <enabled>True</enabled>            </Snapshots>        </pluginrepository>        <pluginrepository>            <ID>Spring-milestones</ID>            <name>Spring Milestones</name>            <URL>Https://repo.spring.io/milestone</URL>            <Snapshots>                <enabled>False</enabled>            </Snapshots>        </pluginrepository>    </pluginrepositories>    <Dependencies>        <!--Web-supported starter Pom -        <Dependency>            <groupId>Org.springframework.boot</groupId>            <Artifactid>Spring-boot-starter-web</Artifactid>        </Dependency>    </Dependencies></Project>

Create a new entry class (Artifactid + Application naming convention) and declare the Ingress class directly as a simple controller as a test:

MAVEN builds Spring boot project manually

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.