GWT + Maven + Error executing (org.bsc.maven:maven-processor-plugin:2.0.5:process:process:generate-sources)

有些话、适合烂在心里 提交于 2020-01-12 17:20:10

问题


I use a clean eclipse 3.7, then added the Maven Integration for Eclipse from the Eclipse Marketplace. I also added WTP Integration and m2e connector for build-helper-maven-plugin from Windows -> Preferences -> Maven -> Discovery -> Open Catalog. I also added the Google Plugin for Eclipse.

I import an exising maven project that works fine with the command line when running command like: mvn compile gwt:compile or mvn gwt:run but in Eclipse I got this error:

Error executing (org.bsc.maven:maven-processor-plugin:2.0.5:process:process:generate-sources)   pom.xml /base   line 289    Maven Build Problem

Here is the related part of the pom file:

<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>

and

<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>

回答1:


I managed to make it work by adding

-vm
C:\Program Files\Java\jdk1.6.0_26\jre\bin\server\jvm.dll

before -vmargs in eclipse.ini




回答2:


As a rule of thumb you always need to change default JRE under Window->Preferences->Java->Installed JREs to JDK folder. In my case it was C:\Program Files\Java\jre6. I had to change it to C:\Program Files\Java\jdk1.6.0_31




回答3:


I had the same problem on a Linux environment, I did the same thing Sydney did above but I still had to disable incremental build for maven processor, like this:

...
   <action>
      <execute>
        <runOnIncremental>false</runOnIncremental>
      </execute>
   </action>
...

This worked for me :)



来源:https://stackoverflow.com/questions/8756431/gwt-maven-error-executing-org-bsc-mavenmaven-processor-plugin2-0-5proces

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!