Docker构建SpringBoot项目—>创建并运行容器,提示“no main manifest attribute, in /app.jar ”错误,如何解决:
修改pom.xml文件:注释掉或删掉skip标签,添加includeSystemScope标签,如下所示:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<configuration>
<mainClass>com.soft.DemoApplication</mainClass>
<!-- <skip>true</skip> -->
<!-- 将上面skip标签注释掉或删掉,添加如下includeSystemScope标签 -->
<includeSystemScope>true</includeSystemScope>
</configuration>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>