我在父POM中声明
<dependencyManagement>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
<scope>compile</scope>
</dependency>
</dependencyManagement>
进一步说,子POM 的使用。
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
</dependencies>
所有工作正常吗?但是当我使用类型为pom的依赖项时。
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-7.0</artifactId>
<version>${jboss-javaee-7.0.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencyManagement>
我遇到了错误
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project by.services:by.utils:1.0.2 (D:\Work\V2_Change_Maven_Structure\by.utils\pom.xml) has 1 error
[ERROR] 'dependencies.dependency.version' for org.jboss.spec:jboss-javaee-7.0:jar is missing. @ line 18, column 21
[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.
如何在dependencyManagement中声明类型为pom的依赖项 声明$ {Jboss-javaee-7.0.version} 如果我在根目录下使用jboss-javaee-7.0,则运行。