eclipsemavenm2eauto-build

Maven Eclipse Autobuilder keeps on building even though nothing changed


I use Eclipse (Indigo) with the M2E plugin for maven. Now for some reason the autobuilder keeps on rebuilding the project with no changes around 50 times before he's satisfied which takes a lot of resources and is a major pain...

I get the following output again and again:

14.12.11 12:32:17 MEZ: Maven Builder: AUTO_BUILD requireFullBuild
14.12.11 12:32:17 MEZ: [WARN] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
14.12.11 12:32:17 MEZ: [INFO] Copying 2 resources
14.12.11 12:32:17 MEZ: [INFO] Nothing to compile - all classes are up to date
14.12.11 12:32:17 MEZ: [WARN] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
14.12.11 12:32:17 MEZ: [INFO] Copying 5 resources

I've tried to disable the Auto Builder and set Maven to offline but nothing seems to help. Why does he even "require a full build" ?

This behaviour is also triggerd by any content change in the code however minor (like setting a final variable to a different int value).

How can I track this back to the source? Other projects don't seem to show this behaviour.. I don't understand how M2E gets the impression a full rebuild is required even though it did JUST THAT...

Thanks!

Edit per Comment:

We have the following plugin setup in our pom:

<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <configLocation>checkstyle.xml</configLocation>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>

            <!-- Javadoc -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Source Jar -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-java2ws-plugin</artifactId>
                <version>${cxf.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.cxf</groupId>
                        <artifactId>cxf-rt-frontend-jaxws</artifactId>
                        <version>${cxf.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.cxf</groupId>
                        <artifactId>cxf-rt-frontend-simple</artifactId>
                        <version>${cxf.version}</version>
                    </dependency>
                </dependencies>

                <executions>
                    <execution>
                        <id>process-classes</id>
                        <phase>process-classes</phase>
                        <configuration>
                            <className>path.to.PersonService</className>
                            <genWsdl>true</genWsdl>
                            <verbose>true</verbose>
                        </configuration>
                        <goals>
                            <goal>java2ws</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-webdav-jackrabbit</artifactId>
                <version>1.0</version>
            </extension>
        </extensions>

    </build>

Solution

  • It depends what plugins you have bound to the phases up to and including compile. M2E should cope with the default plugins (maven-compiler-plugin, maven-resources-plugin) etc. Do you have some code-generation (JAXB etc.) plugins included?

    EDIT

    I've had no end of problems with m2e and code generation; eventually I reverted to m2eclipse which is still quite buggy.

    I recommend you move your cxf wsdl generation to a different module of the same project and then add it as a dependency. Keep that project closed in Eclipse (once you've mvn install'd it) unless you're editing it.

    Hopefully that kind of workaround will become unnecessary as m2e improves.