idea使用maven,管理多模块工程

使用maven clean 会清理项目下target目录,即已经打包的jar包或者war包。

然后使用maven install 即可构建项目,这样在多模块工程中的相互依赖包才会起作用,比如client工程依赖了common工程,

同时,注意在pom.xml中,引入这些依赖

<!--增加本工程下公共包的依赖-->
            <dependency>
                <groupId>com.imooc</groupId>
                <artifactId>common</artifactId>
                <version>1.0.0</version>
            </dependency>

common工程的pom.xml指定为jar包

  <artifactId>common</artifactId>
    <packaging>jar</packaging>

注意spring boot 工程,(spring cloud项目),即使common包不需要启动发布,也需要,启动的主类,否则会报错。

repackage failed: Unable to find main class -> [Help 1]

猜你喜欢

转载自blog.csdn.net/RUIMENG061511332/article/details/83058123