no main manifest attribute, in /

时间:2025-04-25 08:26:32

Docker构建SpringBoot项目—>创建并运行容器,提示“no main manifest attribute, in / ”错误,如何解决:

修改文件:注释掉或删掉skip标签,添加includeSystemScope标签,如下所示:

<plugin>
    <groupId></groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <version>${}</version>
    <configuration>
        <mainClass></mainClass>
        <!-- <skip>true</skip> -->
        <!-- 将上面skip标签注释掉或删掉,添加如下includeSystemScope标签 -->
        <includeSystemScope>true</includeSystemScope>
    </configuration>
    <executions>
        <execution>
            <id>repackage</id>
            <goals>
                <goal>repackage</goal>
            </goals>
        </execution>
    </executions>
</plugin>