7

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>
Sydney
  • 11,964
  • 19
  • 90
  • 142

3 Answers3

8

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

Sydney
  • 11,964
  • 19
  • 90
  • 142
  • Glad it works for me, however could you please explain why add this parameter? – Mike Feb 13 '12 at 11:50
  • I don't know why it works, I just found that fix on another web site among other non-working solutions. Since it worked for me I decided to post the answer on SO. – Sydney Feb 13 '12 at 12:57
  • I got the same issue on Mac OSX, do you know how can I fix this? Thanks. It worked for me before, but now it has error in the same eclipse. Strange. – Jake W Mar 19 '12 at 12:22
  • @JiakuanW: I too have this problem on OS X, but the suggested fix above (running Eclipse under the JVM from JDK1.6 - see instructions at http://wiki.eclipse.org/Eclipse.ini#-vm_value:_Mac_OS_X_Example and use path `/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java`) makes no difference; did you manage to resolve it some other way? – eggyal Apr 01 '12 at 09:36
  • 1
    I found this was actually a message for requestfactor compile errors in eclipse. That was because I didn't add @ProxyFor annotation for a proxy class. After I fixed the compile issue, the error was gone. Please run "mvn clean install" from command line first, and make sure it compiles and generates source code successfully. And then refresh/clean/rebuild in eclipse, the issue should be gone. – Jake W Apr 01 '12 at 13:20
  • As I said in the original post, my code compiled using the command line. The error only occurred in Eclipse. The only fix I found is the one I posted which seems to work. – Sydney Apr 05 '12 at 15:11
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

Zhaidarbek
  • 310
  • 2
  • 12
0

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

Christian
  • 305
  • 1
  • 4
  • 13