如何避免将Spring Boot胖罐安装/部署到Maven回购

问题描述 投票:0回答:1

我们正在使用spring-boot-maven-plugin的repackage任务来打包fat-jar(下面的示例pom.xml),并尝试了<attach>false</attach>,但似乎fat-jar将被安装/部署无论如何。

当前,我们配置了maven- {install,deploy} -plugin的<skip>true</skip>来解决此问题,但不确定如何使用启动插件的<attach>或其他方法来解决此问题。

<plugin>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-maven-plugin</artifactId>
  <version>2.2.4.RELEASE</version>
  <executions>
    <execution>
      <id>repackage</id>
      <goals>
        <goal>repackage</goal>
      </goals>
      <configuration>
        <attach>false</attach>
      </configuration>
    </execution>
  </executions>
</plugin>

谢谢

java spring spring-boot maven
1个回答
0
投票

您必须像这样正确配置它:

<plugin>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-maven-plugin</artifactId>
  <version>2.2.4.RELEASE</version>
  <executions>
    <execution>
      <id>repackage</id>
      <goals>
        <goal>repackage</goal>
      </goals>
      <configuration>
        <attach>false</attach>
      </configuration>
    </execution>
  </executions>
</plugin>
© www.soinside.com 2019 - 2024. All rights reserved.