【发布时间】:2013-01-08 19:17:05
【问题描述】:
我在自己的配置文件中运行wsgen,因为我不希望它在每次构建产品时都运行。但是当我运行它时,我收到一个关于缺少版本的错误:
$ mvn package -P wsgen [INFO] 正在扫描项目... [ERROR] build 无法读取 1 个项目 -> [Help 1] [ERROR] [ERROR] 项目项目-ejb:2.3.15-SNAPSHOT (C:\Projects\MyProject\pom.xml) 有 1 个错误 [错误]
'build.plugins.plugin[org.jvnet.jax-ws-commons:jaxws-maven-plugin].dependencies.dependency.version' 对于 org.glassfish:javax.javaee:jar 丢失。 @ 第 167 行,第 41 列 [ERROR] [ERROR] 要查看错误的完整堆栈跟踪,请重新运行 带有 -e 开关的 Maven。 [错误] 使用 -X 开关重新运行 Maven 启用完整的调试日志记录。 [错误] [错误] 有关更多信息 错误和可能的解决方案,请阅读以下文章: [错误] [帮助 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
这是子 pom(带有配置文件的 pom)的 sn-p:
<packaging>ejb</packaging>
<parent>
<artifactId>MyProject</artifactId>
<groupId>project</groupId>
<version>2.3.15-SNAPSHOT</version>
</parent>
<profiles>
<profile>
<id>wsgen</id>
<build>
<plugins>
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.1</version>
<executions>
...
</executions>
<dependencies>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.javaee</artifactId>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
但是,在父 pom 中,我在 dependencyManagement 标记下定义了这个依赖项及其版本。
我认为正在发生的事情是配置文件没有继承父级的 dependencyManagement 标记,因此它认为依赖项缺少版本号。有没有办法让配置文件从父母那里继承这个?
【问题讨论】: