Order of classpathentry in .classpath for debugging libraries

For debugging a library it can be helpful to add the library project to the classpath of a Eclipse. The library project must be before jar file of the library. Means it must be before the org.eclipse.buildship.core.gradleclasspathcontainer

This is only a local change and should not checkin because other of the team does not have checkout the library.

The problem is that a “Refresh Gradle Project” change the order of classpathentry. Other eclipse project are ever after the gradle classpath container.

This required to restore the project classpath multiple times on the day (after every refresh).

Can I tell Buildship a different order of the classpathentry in the .classpath file. For example with whenMerged?

Is there a Gradle Refesh which does not change the project file? The refesh is called only to download the latest versions of the dependencies from the build system. Never want a change of the configuration files.

A workaround is to move the classpathentry of other project before any src folder. This look like:

<?xml version="1.0" encoding="UTF-8"?>
	<classpathentry combineaccessrules="false" kind="src" path="/LibraryToDebug"/>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="src" path="test"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
	<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
	<classpathentry kind="output" path="bin"/>