Launchers lose Buildship classpath on import, regain it later

My Gradle 4.5 project includes several Eclipse launch configurations stored in XML .launch files. When I import the project into Eclipse Oxygen.2 (4.7.2) using Buildship 2.2.1’s “Import → Existing Gradle Project”, every .launch file has the following line removed:

<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.buildship.core.classpathprovider"/>

If I subsequently bring up Eclipse’s “Run Configurations” dialog and revisit the configuration of any one of these launchers, that launcher is silently updated to restore the Buildship classpath provider line that had been removed on import. I do not even need to edit any of the configuration settings; simply selecting any launch configuration from the left-side list is enough to have the aforementioned line re-added.

The repeated churn of removing/restoring this line is distracting, especially given that the .launch files are tracked by version control. If the Buildship classpath provider should be present, then why is it being removed during import? Is there something I can do in my Gradle configuration to prevent this?

This should not happen. If you import a Gradle project, the update should touch the associated run configurations, and it should add the classpath provider, not remove it. I’ll look into this.

Thank you, @donat! If you cannot reproduce the problem in a simple setup, then you are welcome to try the real project on which I am seeing this: an experimental Gradle-built branch of the T. J. Watson Libraries for Analysis (WALA). We hope that this will eventually replace the Maven build system entirely, though we still have a long way to go.

Thanks for the reference. In fact, the WALA sources helped me investigate the issue. It looks like there’s a problem in our synchronization logic. I’ve opened an issue for it:

1 Like