zoukankan      html  css  js  c++  java
  • idea 创建maven子父工程

    1.创建maven工程:

    2. 创建工程名称:

     

     3.删除父工程下的src文件夹,指定打包方式为pom,添加maven依赖:

     4.右键项目添加子工程:

     

     5.添加子工程名称:

     6.子工程创建成功:

     7.依次类推创建多个子工程:

    8.在student-server搭建springboot工程:

    添加pom.xml文件

    <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <build.jdk.version>1.8</build.jdk.version>
    <spring.boot.version>1.5.9.RELEASE</spring.boot.version>
    <slf4j.version>1.7.25</slf4j.version>
    </properties>


    <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <version>${spring.boot.version}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <version>${spring.boot.version}</version> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.47</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>${slf4j.version}</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>${build.jdk.version}</source> <target>${build.jdk.version}</target> </configuration> </plugin> </plugins> </build>

    9.创建启动类Application和测试Testcontroller:

    Application:

    @SpringBootApplication
    public class Application {
        private static final Logger LOG = LoggerFactory.getLogger(Application.class);
    
        public static void main(String[] args) {
            SpringApplication app = new SpringApplication(Application.class);
            app.setBannerMode(Banner.Mode.OFF);
            app.setWebEnvironment(true);
            app.run(args);
            LOG.info("**************** Startup Success ****************");
        }
    }

    TestController:

    @Controller
    public class TestController {
    
        @RequestMapping("/test")
        @ResponseBody
        public String test(String str) {
            System.out.println("*********" + str + "*******");
            return str;
        }
    }

    10.运行Application类main方法启动springboot:

     成功

  • 相关阅读:
    excel 2003系列
    DataTab转换XML XML转换DataTable 的类[转]
    全角转半角与半角转全角
    Day2
    Day6 && Day7图论
    Day1
    Android为何以及如何保存Fragment实例
    Android应用的本地化及知识拓展之配置修饰符
    Leetcode NO.136 Single Number 只出现一次的数字
    经典排序算法(四) —— Quick Sort 快速排序
  • 原文地址:https://www.cnblogs.com/chong-zuo3322/p/12109465.html
Copyright © 2011-2022 走看看