java - maven 无法识别来自 build-helper-maven-plugin 的执行标记

标签 java gwt maven

我正在尝试使用 Maven 将资源(.java、.gwt.xml、.ui.xml)从项目 A 导出到项目 B。所以在项目 A 中,我编写了以下 pom:

<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
    <groupId>com.pe.interbank</groupId>
    <artifactId>reactor</artifactId>
    <version>1.0.0</version>
    <relativePath>../reactor</relativePath>
</parent>


<properties>
    <path2>Reactor/pom.xml</path2>
    <path1>C:/Angelo/Workspace/MultipleGWTv2/Reactor/pom.xml</path1>
</properties>

<artifactId>transferencias</artifactId>
<packaging>jar</packaging>
<name>transferencias</name>

<build>
    <resources>
        <resource>
            <directory>src/main/java</directory>
            <includes>
                <include>**/*.java</include>
                <include>**/*.gwt.xml</include>
            </includes>
        </resource>
    </resources>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <execution>
                <phase>generate-sources</phase>
                <goals>
                    <goal>add-source</goal>
                </goals>
                <configuration>
                    <sources>
                        <source>src/main/java</source>
                    </sources>
                </configuration>
            </execution>
        </plugin>
    </plugins>
</build>

<dependencies>
    <dependency>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>2.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.7</version>
    </dependency>
</dependencies>

但是当我运行 Install Maven 时出现了这个错误:

The build could not read 1 project -> [Help 1]

The project com.pe.interbank:transferencias:1.0.0 (C:\Angelo\Workspace\MultipleGWTv2\Transferencias\pom.xml) has 1 error

 Malformed POM C:\Angelo\Workspace\MultipleGWTv2\Transferencias\pom.xml: Unrecognised tag: 'execution' (position: START_TAG seen ...</artifactId>\r\n\t\t\t\t<execution>... @36:16)  @ C:\Angelo\Workspace\MultipleGWTv2\Transferencias\pom.xml, line 36, column 16 -> [Help 2]

有人知道为什么吗?

谢谢。

最佳答案

<execution>元素必须用 <executions> 包围收集容器,即使您指定单个 <execution> .

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>build-helper-maven-plugin</artifactId>
  <executions> <!-- Notice the container element here -->
    <execution>
    ...

关于java - maven 无法识别来自 build-helper-maven-plugin 的执行标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11476196/

相关文章:

java -/storage/emulated/0/Notes/(没有这样的文件或目录)?

java - GWT 客户端全局配置值

java - 为什么 Google Precondition Library 中的 Checkers 接受对象而不是字符串

java - 如何在 Maven 中跳过生成源

java - 从 14 :00 to 17:30 开始每分钟使用quartz进行调度

java - 当剪贴板内容在java之外发生变化时是否可以得到通知

java - DHIS-2 未运行

java - Spring 版本自动更改为 3.0.5.RELEASE 尽管我指定了 3.1.0

java - 使用三角形带对球体进行纹理化时出现问题

java - 使用内联编辑模式时,GXT3 Grid 无法发送复选框事件