我使用了一个干净的Eclipse 3.7,然后从Eclipse Marketplace添加了Maven Integration for Eclipse
。我还在Windows中添加了WTP Integration
和m2e connector for build-helper-maven-plugin
- >偏好 - > Maven - >发现 - >打开目录。我还添加了Google Plugin for Eclipse。
我在运行如mvn compile gwt:compile
或mvn gwt:run
之类的命令时导入一个可以在命令行中运行的exising maven项目,但是在Eclipse中我遇到了这个错误:
Error executing (org.bsc.maven:maven-processor-plugin:2.0.5:process:process:generate-sources) pom.xml /base line 289 Maven Build Problem
以下是pom文件的相关部分:
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>2.0.5</version>
<executions>
<execution>
<id>process</id>
<phase>generate-sources</phase>
<goals>
<goal>process</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.google.web.bindery</groupId>
<artifactId>requestfactory-apt</artifactId>
<version>${gwt.version}</version>
</dependency>
</dependencies>
</plugin>
和
<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.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<versionRange>[2.0.5,)</versionRange>
<goals>
<goal>process</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
答案 0 :(得分:8)
我设法通过添加
使其工作-vm
C:\Program Files\Java\jdk1.6.0_26\jre\bin\server\jvm.dll
在-vmargs
中的eclipse.ini
之前
答案 1 :(得分:2)
根据经验,您始终需要将Window-&gt; Preferences-&gt; Java-&gt; Installed JRE下的默认JRE更改为JDK文件夹。在我的例子中,它是C:\ Program Files \ Java \ jre6。我不得不将其更改为C:\ Program Files \ Java \ jdk1.6.0_31
答案 2 :(得分:0)
我在Linux环境中遇到了同样的问题,我做了同样的事情悉尼上面做了但我仍然必须禁用maven处理器的增量构建,如下所示:
...
<action>
<execute>
<runOnIncremental>false</runOnIncremental>
</execute>
</action>
...
这对我有用:)