[英]Not able to compile Maven project due to dependencies.dependency.version is missing
Why do I get an error when I try to clean and compile my Maven project from the root folder? 尝试从根文件夹中清理并编译Maven项目时,为什么会出现错误? I use the top level POM for defining dependencies in the dependencyManagement element. 我使用顶级POM在DependencyManagement元素中定义依赖项。 I want to use it in the library projects. 我想在图书馆项目中使用它。
I have the following Maven project structure: 我具有以下Maven项目结构:
POM
Library1
POM
Module1
POM
Module2
POM
Library2
Module1
POM
Module2
POM
From top level POM: 从顶级POM:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>1.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
</dependencyManagement>
Library POM: 库POM:
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
</dependency>
</dependencies>
I needed to add type element in the dependency. 我需要在依赖项中添加type元素。
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<type>pom</type>
</dependency>
</dependencies>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.