我必须添加到主 pom 才能跳过它: <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <skip>true</skip> </configuration> </plugin> 然后在带有 ma Application 类的模块中: <plugin> <groupId>org.springframework.boot</groupId> ...
这时候,我们就需要在 maven 的 pom.xml 文件中指定打包时的 mainClass,具体是在 spring-boot-maven-...
然后cmd切换到项目根路径执行打包命令:mvn clean package -Dmaven.test.skip=true 全栈程序员站长 2022/09/02 3.3K0 SpringBoot项目多模块打包 java打包jarroottarget 直接开始吧 先对整个项目的父工程(root)进行clean和install 中途可能会遇到clean失败的情况,大概率是循环依赖的问题,根据报错内容自己好好检查某个模...
最后发现是插件必须配置<skip>true</skip>这个节点。 完整来说,就是在pom文件(或者父pom中),有这样一个配置: <build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><configuration><skip>true</skip></configuration></plugin></plugins></bu...
解决方法就是把skip设置成false <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>${spring-boot.version}</version> <configuration> <mainClass>com.example.TliasWebManagementApplication</mainClass> ...
在没有启动类模块的pom.xml中,添加 <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <skip>true</skip> </configuration> </plugin> </plugins></build> 加上这个就可了发布...
或者,你也可以在父POM中配置该插件时,通过<configuration>标签中的<skip>属性来控制是否跳过某些模块的打包操作。 按照以上步骤进行排查和解决,通常可以解决Maven打包时出现的“unable to find main class”错误。如果问题仍然存在,请检查更详细的项目配置和环境设置。
解决方法在公共模块中的pom文件加入如下配置 <build> <plugins> <plugin> <!-- 公共模块 Unable to find main class--> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <skip>true</skip> ...
Skip to content Navigation MenuToggle navigation Sign in Product GitHub Copilot Write better code with AI Security Find and fix vulnerabilities Actions Automate any workflow Codespaces Instant dev environments Issues Plan and track work Code Review Manage code changes Discussions Collaborate ...
正确的dockerfile:从maven:3.6.0-jdk-11-slim as 建造复制src/home/app/src复制pom.xml/home/app...