使用IDEA创建spring-boot的maven module

2020-02-13  本文已影响0人  Iravinota
  1. 在某个project中,点击External Libraries


    external library.png
  2. 点击 File->New->Module,选择Maven, 直接选择next


    maven
  3. 输入信息


    groupid
  4. 修改moduel name,finish


    module name
  5. 修改pom.xml,添加依赖信息,类似:

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.2.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
  1. 在src/main/java目录中添加java程序,在resources目录下添加资源文件
上一篇下一篇

猜你喜欢

热点阅读