Maven 父子工程出现 [ERROR] 'dependencies.dependency.version' for xxxjar is missing. 问题

别来无恙 提交于 2020-02-16 11:40:37

问题原因是,子工程(Sub1)所继承的父工程(Main)也继承了它的父工程(Parent),需要在(Main)这个父工程中pom.xml配置中,增加

relativePath:

    <parent>
        <groupId>cn.corpdata.framework</groupId>
        <artifactId>framework-parent</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <relativePath>../framework-parent/pom.xml</relativePath>
    </parent>

测试Maven工程的报错如下:

[ERROR] 'dependencies.dependency.version' for mysql:mysql-connector-java:jar is missing. @ cn.corpdata.framework:framework-dao:[unknown-version], /Users/admin/Documents/workspace-sts-3.8.4.RELEASE/framework-main/framework-dao/pom.xml, line 19, column 15
[ERROR] 'dependencies.dependency.version' for commons-dbcp:commons-dbcp:jar is missing. @ cn.corpdata.framework:framework-dao:[unknown-version], /Users/admin/Documents/workspace-sts-3.8.4.RELEASE/framework-main/framework-dao/pom.xml, line 25, column 15
[ERROR] 'dependencies.dependency.version' for org.springframework:spring-context:jar is missing. @ cn.corpdata.framework:framework-dao:[unknown-version], /Users/admin/Documents/workspace-sts-3.8.4.RELEASE/framework-main/framework-dao/pom.xml, line 31, column 15
[ERROR] 'dependencies.dependency.version' for org.mybatis:mybatis:jar is missing. @ cn.corpdata.framework:framework-dao:[unknown-version], /Users/admin/Documents/workspace-sts-3.8.4.RELEASE/framework-main/framework-dao/pom.xml, line 37, column 15

[ERROR] 

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR] 

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!