maven install时报错:程序包不存在以及找不到类Unable to find main class

一个微服务通常有两个子module,module-rpc写实体类和接口 module-server一个写实现方法含有主启动类

打包编译module-rpc时候发现maven install报错 Unable to find main class  它本身是不需要主启动类的,需要排除

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <!-- 解决没有main函数报错unable to find main class 的问题-->
                <executions>
                    <execution>
                        <phase>none</phase>
                    </execution>
                </executions>
                <configuration>
                    <classifier>execute</classifier>
                </configuration>
            </plugin>
        </plugins>
    </build>

 

posted @ 2026-08-20 09:41  ジ绯色月下ぎ  阅读(11)  评论(0)    收藏  举报