zoukankan      html  css  js  c++  java
  • SpringCloud多模块依赖打包问题

    Maven:多模块打包报错 Failed to read artifact descriptor for xxx:jar

    1)项目中有多个模块,例如:父模块1,子模块2,common模块。现在需要在子模块2中引用common模块中的内容。在已经成功将common模块的jar安装到本地仓库后,

    编译子模块2 一直报错:Failed to read artifact descriptor for xxx:jar

    解决问题如下:
    一)在父模块1中将整个项目clean>compile>package>install 一遍。
    二)在父模块中的pom中的build插件注释掉。
    三)单独对common模块进行clean>compile>package>install
    四)将父模块中的pom中的build插件放开。
    五)重新单独对子模块2 进行编译,就不会报错了。

    原因可能是被引用的模块如果采用springboot插件打包会将相关依赖包打进去,然后其他调用的模块也有相关的依赖包,会有冲突。

    <build>
    <plugins>
    <!--解决SpringBoot打包成jar后运行提示没有主清单属性-->
    <plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <executions>
    <execution>
    <goals>
    <goal>repackage</goal>
    </goals>
    </execution>
    </executions>
    </plugin>
    </plugins>
    </build>

  • 相关阅读:
    自动化CodeReview
    10个有关RESTful API良好设计的最佳实践
    ASP.NET Core 获取控制器上的自定义属性
    [转] Autofac创建实例的方法总结
    PetaPoco
    LogViewer
    hdoj:2047
    hdoj:2046
    hdoj:2045
    hdoj:2044
  • 原文地址:https://www.cnblogs.com/fishjar/p/10246463.html
Copyright © 2011-2022 走看看