Sybuser
Sybuser

Reputation: 1382

Eclipse gives up incremental build and goes systematically for full clean and rebuild

Version : Eclipse 2024-03 for Java developers (but also tried older versions of Eclipse, all with the same issue)

This issue seems to happen only on a large projects.

The following settings are activated :

I experienced the following problems :

Important note: I do not use any integrated build tools such buildship (Gradle) or m2e (Maven).

Here is the .project file of the larger project :

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>some-project</name>
    <comment/>
    <projects/>
    <natures>
        <nature>org.eclipse.jdt.core.javanature</nature>
        <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
    </natures>
    <buildSpec>
        <buildCommand>
            <name>org.eclipse.jdt.core.javabuilder</name>
            <arguments/>
        </buildCommand>
    </buildSpec>
    <linkedResources/>
</projectDescription>

Classpath file:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
  <classpathentry including="**/*" kind="src" path="src/main/java"/>
  <classpathentry including="**/*" kind="src" path="src/main/resources/etc"/>
  <classpathentry excluding="etc/**" including="**/*" kind="src" path="src/main/resources"/>
  <classpathentry kind="src" output="build/classes/test" path="src/test/java">
    <attributes>
      <attribute name="test" value="true"/>
    </attributes>
  </classpathentry>
  <classpathentry kind="src" output="build/classes/test" path="src/test/resources">
    <attributes>
      <attribute name="test" value="true"/>
    </attributes>
  </classpathentry>
  <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
  <classpathentry exported="true" kind="lib" path="/path/to/some-library.jar" sourcepath="/path/to/some-library-sources.jar">
    <attributes>
      <attribute name="org.eclipse.jst.component.dependency" value="../"/>
    </attributes>
  </classpathentry>
  <!-- skipped other lib entries similar to this one -->
  <classpathentry exported="true" kind="lib" path="C:/root/client/resources">
    <attributes>
      <attribute name="org.eclipse.jst.component.nondependency" value=""/>
    </attributes>
  </classpathentry>
  <classpathentry kind="output" path="build/classes/main"/>
</classpath>

It has to do with the structure of the projects :

root
+---extensions
    +---projects
        +---some-project

All projects from the tree are General Projects except some-project which is a Java Project.

When I remove project root from workspace, the problem disappears. When I add it back to the workspace, the problem reappears.

I could have only root as General Project and some-project as Java Project inside the workspace. But even with these 2, I still have the issue.

Also, I tried to add a resource filter to exclude some-project from root, but it didn't help. Even closing root project didn't help, only removing it helped.

If I replace C:/root/client/resources with /root/client/resources in the .classpath of some-project, I don't have this issue of full clean and rebuild on java source changes. This syntax with leading / requires to have root (C:\root) as project in the workspace.

This quick fix on the .classpath is a sufficient workaround but I still cannot reproduce this behavior on a sample project.

See also my bug report here : https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/1347

Upvotes: 1

Views: 166

Answers (0)

Related Questions