简体   繁体   English

了解多模块项目中的 Spring Boot Maven 插件

[英]understanding Spring Boot Maven Plugin in Multi-Module projects

I'm learning about Spring Boot multi module projects and I try to understand what exactly does spring boot maven plugin.我正在学习 Spring Boot 多模块项目,我试图了解 spring boot maven 插件到底是什么。

For example I have 2 different projects.例如,我有 2 个不同的项目。 In the first project I have the spring boot maven plugin in the web module:在第一个项目中,我在 web 模块中有 spring boot maven 插件:

<build>
  <plugins>
    <plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
      <version>2.0.4.RELEASE</version>
      <configuration>
        <mainClass>dgs.web.DemoApplication</mainClass>
        <layout>ZIP</layout>
      </configuration>
      <executions>
        <execution>
          <goals>
            <goal>repackage</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

And in the second project I have this plugin in the data module:在第二个项目中,我在数据模块中有这个插件:

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
         <executions>
             <execution>
                 <goals>
                     <goal>repackage</goal>
                 </goals>
                 <configuration>
                     <skip>true</skip>
                 </configuration>
             </execution>
         </executions>
        </plugin>
    </plugins>
</build>

And this is in the parent pom of the 2nd project:这是在第二个项目的父 pom 中:

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

Can somebody explain me what exaclty does this spring boot maven plugin especially in the second project?有人可以解释一下这个 spring boot maven 插件特别是在第二个项目中有什么好处吗? And why there is no reference about mainClass.以及为什么没有关于mainClass的参考。 I see this mainClass tag only in the first project.我只在第一个项目中看到这个 mainClass 标签。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM