Class EclipseConfigurator

All Implemented Interfaces:
Generator, Renamable, ResourceProvider

The EclipseConfigurator provides the resource EclipseConfiguration. "The configuration" consists of the Eclipse configuration files for a given project. The configurator generates the following files as W3C DOM documents (for XML files) or as Properties for a given project:

  • .project,
  • .classpath,
  • .settings/org.eclipse.core.resources.prefs,
  • .settings/org.eclipse.core.runtime.prefs and
  • .settings/org.eclipse.jdt.core.prefs.

Each generated data structure can be post processed by a corresponding adapt method before being written to disk. Additional resources can be generated by the method adaptConfiguration(Runnable).

Eclipse provides project nesting, but the outer project does not define a namespace. This can lead to problems if you have multiple (sub)projects with the same name in the workspace. The configurator allows you to define an alias for the project name to avoid this problem. This alias is used as Eclipse project name in all generated files.

If a project is a MergedTestProject, the configurator merges the information from this test project into the configuration files of its parent project. Resources that the test project depends on will be added as "test only" class path resources and the folder with the sources for the java compiler will be added as "test sources".