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

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

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

然后使用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]

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

 

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

 

相关文章:

  • 2021-11-26
  • 2021-10-20
  • 2021-12-25
  • 2021-09-01
  • 2021-07-07
  • 2021-09-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-02
  • 2021-12-31
  • 2022-12-23
  • 2022-12-26
  • 2022-12-23
  • 2021-07-02
  • 2022-12-23
相关资源
相似解决方案