【发布时间】:2012-04-08 06:21:35
【问题描述】:
我是 Maven 的新手。我正在尝试添加 JAXB2 插件和依赖项以从 xsd 生成 xml 文件。当我在依赖项下添加时,会在标记下引发错误:-
生命周期配置未涵盖插件执行:org.jvnet.jaxb2.maven2: maven-jaxb2-plugin:0.7.4:generate(execution: default, phase: generate-sources)
错误被标记在 jaxb2 插件中的标签上。我添加了这个标签来参考互联网上的解决方案,但没有任何效果。
我的 pom.xml 看起来像这样:-
<build>
<finalName>PatternsWebapp</finalName>
<defaultGoal>install</defaultGoal>
<pluginManagement>
<plugins>
<!-- This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.appfuse.plugins
</groupId>
<artifactId>
maven-warpath-plugin
</artifactId>
<versionRange>
[2.1.0,)
</versionRange>
<goals>
<goal>add-classes</goal>
</goals>
</pluginExecutionFilter>
<action>
<execution></execution>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.7.4</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<verbose>true</verbose>
<schemaDirectory>src/main/resources</schemaDirectory>
<generatePackage>com.webapp.xml</generatePackage>
</configuration>
</plugin>
<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
【问题讨论】:
-
大家好,我找到了解决这个问题的方法。我只需要为 jaxb 添加 m2e 插件即可解决该错误。
-
+1 给你们俩。这提供了很大的帮助。谢谢
标签: eclipse maven jaxb maven-plugin m2eclipse