Eclipse creates spring boot aggregation project

Eclipse creates spring boot aggregation project

1. Create parent project

1.1 create a Maven project

1.2 create a simple project

1.3 fill in basic information of the project

1.4 project directory structure

1.5 write pom.xml file information of parent project

<project xmlns=""

    <!-- Project Description: as the parent project of aggregation project -->

    <description>This is a Maven Parent project of aggregate project</description>

    <!-- Setting parent class,Integrate common third-party framework dependency information(Various dependent information),Inheritance here SpringBoot Parent project provided -->
        <relativePath /> <!-- lookup parent from repository -->

    <!-- Set common parameters -->

        <!-- 1.Introduce springboot Core package,integration SpringMVC Web assembly -->
        <!-- Implementation principle: Maven Dependent inheritance,It is equivalent to using the third party frequently Maven Dependent information,stay parent It's packaged in the project -->

        <!-- 2. Introduce springboot Test package -->

        <!-- 3. springboot external tomcat Support,For compilation jsp -->

        <!-- 4. hit war Add this item when package, tell spring-boot tomcat Relevant jar It's all external. Don't type it in -->


                    <skipTests>true</skipTests><!--Turn unit tests off by default -->

2. Create subproject

2.1 create a Maven subproject

2.2 fill in the name of subproject

2.3 select sub project prototype

2.4 fill in basic information

2.5 project directory structure

Note: if the child item is displayed horizontally with the parent item, you can perform the following operations, and switch the operation view

2.6 the pom.xml file of the parent project has referenced the child project, as shown in the figure:

2.7 write pom.xml file information of subproject

<?xml version="1.0"?>

    <!-- Project Description: as a sub project of polymerization project -->
    <!-- Packing method is war,Not written as default jar -->

    <!-- Setting parent class,,Inheritance here parenteProject Parent project -->

2.8 modify the startup class of the Spingboot subproject

package org.project.web;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

public class App {
    public static void main(String[] args) {, args);

2.9 add a test class

package org.project.web.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

public class TestController {

    public String sayHello() {
        return "How do you do~!";

2.10 start Springboot

2.11 testing,


3. Repeat step 2 to create multiple subprojects

Tags: Java Maven Apache Spring SpringBoot

Posted on Sat, 02 Nov 2019 13:11:23 -0700 by project168