如何制定以下项目结构?

时间:2019-08-29 13:35:18

标签: java maven spring-boot pom.xml

我需要将Spring Boot上的项目作为模块进行连接。这样我的结构如下:

-projects
-pom.xml
-----webapp
-----pom.xml

我需要怎么做才能得到这样的项目结构?这是我当前的pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="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>my-project</groupId>
    <artifactId>projects</artifactId>
    <version>1.0.0</version>
    <packaging>pom</packaging>

    <name>Projects</name>

    <modules>
        <module>webapp</module>
    </modules>


</project>

然后:

<project xmlns="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>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.0.M1</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>my-project</groupId>
    <artifactId>webapp</artifactId>
    <version>1.0.0</version>
    <name>WebApp</name>
    <description>This webapp for search work</description>
    .......other code


</project>

0 个答案:

没有答案