idea maven打包错误 程序包common不存在


背景:父级项目Root, springboot项目A,common模块B,业务模块C

问题:刚开始打包root,提示程序包common不存在

尝试:先install B,再install C, 最后package A,无效。

解决方案:将root中的pom文件中关于springboot自带的maven插件注释掉

  <build>
<!-- <plugins>-->
<!-- <plugin>-->
<!--&lt;!&ndash; <groupId>org.springframework.boot</groupId>&ndash;&gt;-->
<!--&lt;!&ndash; <artifactId>spring-boot-maven-plugin</artifactId>&ndash;&gt;-->
<!-- <configuration>-->
<!-- <mainClass>com.tile.admin.AdminApplication</mainClass>-->
<!-- <excludes>-->
<!-- <exclude>-->
<!-- <groupId>org.projectlombok</groupId>-->
<!-- <artifactId>lombok</artifactId>-->
<!-- </exclude>-->
<!-- </excludes>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- </plugins>-->
    </build>

在A项目中,pom文件如下

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <classifier>exec</classifier>
                </configuration>
            </plugin>
        </plugins>
    </build>

最后会生成俩个文件

demo.war

demo-exec.war

将demo-exec.war上传到tomcat服务器,部署完成


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM