问题原因是,子工程(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

转载于:https://www.cnblogs.com/zealon/p/7190868.html

GitHub 加速计划 / de / Dependencies
8.61 K
704
下载
A rewrite of the old legacy software "depends.exe" in C# for Windows devs to troubleshoot dll load dependencies issues.
最近提交(Master分支:2 个月前 )
1997a400 - 2 年前
2f423539 - 2 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐