Java Maven多模块依赖项编译问题
在使用IntelliJ的多模块项目中,我的maven依赖关系有一些问题 以下是my maven模块的结构: (1)Java Maven多模块依赖项编译问题,java,spring,spring-boot,hibernate,maven,Java,Spring,Spring Boot,Hibernate,Maven,在使用IntelliJ的多模块项目中,我的maven依赖关系有一些问题 以下是my maven模块的结构: (1) venus是根模块。 (2) architect是architect com模块的父模块。 (3) actions com是actions模块的子模块,services是actions模块的父模块。 (4) architect和services是根模块的直接子模块 - venus - architect - architect-com - src [java
venus
是根模块。
(2) architect
是architect com
模块的父模块。
(3) actions com
是actions
模块的子模块,services
是actions
模块的父模块。
(4) architect
和services
是根模块的直接子模块
- venus
- architect
- architect-com
- src [java classes here]
- services
- actions
- actions-com
- src [java classes here]
架构师、服务和操作模块没有src文件夹(我删除了它们,因为我认为父模块不需要src文件夹)
以下是模块的POM
//维纳斯-根模块
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>co.shock</groupId>
<artifactId>venus</artifactId>
<version>1.0-SNAPSHOT</version>
<modules>
<module>services</module>
<module>services/actions</module>
<module>services/actions/actions-com</module>
<module>architect</module>
<module>architect/architect-com</module>
</modules>
<packaging>pom</packaging>
</project>
以下是构建architect com的my.m2
存储库的路径。以下是快照文件夹的内容
C:\Users\user\.m2\repository\co\shock\venus\architect\architect-com\1.0-SNAPSHOT
- _remote.repositories
- architect-com-1.0-SNAPSHOT.jar
- architect-com-1.0-SNAPSHOT.pom
- maven-metadata-local.xml
我在谷歌上搜索了一整天,但找不到任何解决办法。我想指出正确的方向
我做错了什么?查看错误消息的最后一句:
找不到工件co.shock:venus:pom:1.0-SNAPSHOT
服务
包含:
<groupId>co.shock</groupId>
<artifactId>jupiter</artifactId> <!-- should be 'venus' -->
<version>1.0-SNAPSHOT</version>
维纳斯
公司休克
1.0-快照
但金星包含:
<groupId>co.shock</groupId>
<artifactId>jupiter</artifactId> <!-- should be 'venus' -->
<version>1.0-SNAPSHOT</version>
co.shock
木星
1.0-快照
你只是把行星弄混了。:) 查看错误消息的最后一句:
找不到工件co.shock:venus:pom:1.0-SNAPSHOT
服务
包含:
<groupId>co.shock</groupId>
<artifactId>jupiter</artifactId> <!-- should be 'venus' -->
<version>1.0-SNAPSHOT</version>
维纳斯
公司休克
1.0-快照
但金星包含:
<groupId>co.shock</groupId>
<artifactId>jupiter</artifactId> <!-- should be 'venus' -->
<version>1.0-SNAPSHOT</version>
co.shock
木星
1.0-快照
你只是把行星弄混了。:) 如果需要
安装
,则生成配置完全错误。@Gerold Broser我已经更新了我的帖子。你只能读最后一段。我已经构建了architect com模块。@EddyFreeman您在venus
和architect
和服务
和操作中声明了所有模块。我从来没见过。仅在venus
中声明services
和architect
。聚合层次结构由Maven识别。@GeroldBroser我已经纠正了金星/木星的混淆。事实上,这是帖子中的一个拼写错误。除了服务和架构师之外,我还从venus pom中删除了模块。不过,这些变化都没有解决这个问题。@GeroldBroser它似乎正在工作。所以我接受了你的回答,如果需要安装,那么构建配置就是错误的。@Gerold Broser我已经更新了我的帖子。你只能读最后一段。我已经构建了architect com模块。@EddyFreeman您在venus
和architect
和服务
和操作中声明了所有模块。我从来没见过。仅在venus
中声明services
和architect
。聚合层次结构由Maven识别。@GeroldBroser我已经纠正了金星/木星的混淆。事实上,这是帖子中的一个拼写错误。除了服务和架构师之外,我还从venus pom中删除了模块。不过,这些变化都没有解决这个问题。@GeroldBroser它似乎正在工作。所以我接受了你的回答,你能在Github上做一个示例项目吗?你能在Github上做一个示例项目吗?
C:\3_projects\venus\services\actions\actions-com>mvn clean compile
[INFO] Scanning for projects...
[INFO]
[INFO] ---------< co.shock.venus.services.actions:actions-com >---------
[INFO] Building Services - Actions - Com 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.256 s
[INFO] Finished at: 2020-12-29T21:02:12+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project actions-com: Could not resolve dependencies for project co.shock
.venus.services.actions:actions-com:jar:1.0-SNAPSHOT: Failed to collect dependencies at co.shock.venus
.architect:architect-com:jar:1.0-SNAPSHOT: Failed to read artifact descriptor for co.shock.venus
.architect:architect-com:jar:1.0-SNAPSHOT: Could not find artifact co.shock:venus:pom:1.0-S
NAPSHOT -> [Help 1]
[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/DependencyResolutionException
C:\Users\user\.m2\repository\co\shock\venus\architect\architect-com\1.0-SNAPSHOT
- _remote.repositories
- architect-com-1.0-SNAPSHOT.jar
- architect-com-1.0-SNAPSHOT.pom
- maven-metadata-local.xml
<groupId>co.shock</groupId>
<artifactId>jupiter</artifactId> <!-- should be 'venus' -->
<version>1.0-SNAPSHOT</version>