# Class EclipseModel

java.lang.Object
org.gradle.plugins.ide.eclipse.model.EclipseModel

public abstract class EclipseModel extends Object
DSL-friendly model of the Eclipse project information. First point of entry for customizing Eclipse project generation.

    plugins {
        id 'java'
        id 'eclipse'
        id 'eclipse-wtp' // for web projects only
    }

    eclipse {
      pathVariables 'GRADLE_HOME': file('/best/software/gradle'), 'TOMCAT_HOME': file('../tomcat')

      project {
        //see docs for EclipseProject
      }

      classpath {
        //see docs for EclipseClasspath
      }

      wtp {
        //see docs for EclipseWtp
      }
    }

More examples in docs for `EclipseProject`, `EclipseClasspath`, `EclipseWtp`

Since:
  1.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EclipseModel()`
  Creates a new `EclipseModel`.
  `EclipseModel(Project project)`
  Constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `autoBuildTasks(Object... autoBuildTasks)`
  Set tasks to be executed during the Eclipse auto-build.
  `void`
  `classpath(Closure closure)`
  Configures eclipse classpath information
  `void`
  `classpath(Action<? super EclipseClasspath> action)`
  Configures eclipse classpath information
  `TaskDependency`
  `getAutoBuildTasks()`
  Returns the tasks to be executed during the Eclipse auto-build.
  `EclipseClasspath`
  `getClasspath()`
  Configures eclipse classpath information
  `EclipseJdt`
  `getJdt()`
  Configures eclipse java compatibility information (jdt)
  `protected abstract ObjectFactory`
  `getObjectFactory()`
  Injects and returns an instance of `ObjectFactory`.
  `EclipseProject`
  `getProject()`
  Configures eclipse project information
  `TaskDependency`
  `getSynchronizationTasks()`
  Returns the tasks to be executed before the Eclipse synchronization starts.
  `EclipseWtp`
  `getWtp()`
  Configures eclipse wtp information
  `void`
  `jdt(Closure closure)`
  Configures eclipse java compatibility information (jdt)
  `void`
  `jdt(Action<? super EclipseJdt> action)`
  Configures eclipse java compatibility information (jdt)
  `void`
  `pathVariables(Map<String,File> pathVariables)`
  Adds path variables to be used for replacing absolute paths in classpath entries.
  `void`
  `project(Closure closure)`
  Configures eclipse project information
  `void`
  `project(Action<? super EclipseProject> action)`
  Configures eclipse project information
  `void`
  `setClasspath(EclipseClasspath classpath)`
  Sets the classpath.
  `void`
  `setJdt(EclipseJdt jdt)`
  Sets the jdt.
  `void`
  `setProject(EclipseProject project)`
  Sets the project.
  `void`
  `setWtp(EclipseWtp wtp)`
  Sets the wtp.
  `void`
  `synchronizationTasks(Object... synchronizationTasks)`
  Set tasks to be executed before the Eclipse synchronization.
  `void`
  `wtp(Closure closure)`
  Configures eclipse wtp information
  `void`
  `wtp(Action<? super EclipseWtp> action)`
  Configures eclipse wtp information

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### EclipseModel

    public EclipseModel()
    Creates a new `EclipseModel`.
    Since:
      1.0

  - ### EclipseModel

    @Inject public EclipseModel(Project project)
    Constructor.
    Since:
      5.4

- ## Method Details

  - ### getObjectFactory

    @Inject protected abstract ObjectFactory getObjectFactory()
    Injects and returns an instance of `ObjectFactory`.
    Since:
      4.9

  - ### getProject

    public EclipseProject getProject()
    Configures eclipse project information

    For examples see docs for `EclipseProject`

    Since:
      1.0

  - ### setProject

    public void setProject(EclipseProject project)
    Sets the project.
    Since:
      1.0

  - ### getClasspath

    public EclipseClasspath getClasspath()
    Configures eclipse classpath information

    For examples see docs for `EclipseClasspath`

    Since:
      1.0

  - ### setClasspath

    public void setClasspath(EclipseClasspath classpath)
    Sets the classpath.
    Since:
      1.0

  - ### getJdt

    public EclipseJdt getJdt()
    Configures eclipse java compatibility information (jdt)

    For examples see docs for `EclipseProject`

    Since:
      1.0

  - ### setJdt

    public void setJdt(EclipseJdt jdt)
    Sets the jdt.
    Since:
      1.0

  - ### getWtp

    public EclipseWtp getWtp()
    Configures eclipse wtp information

    For examples see docs for `EclipseWtp`

    Since:
      1.0

  - ### setWtp

    public void setWtp(EclipseWtp wtp)
    Sets the wtp.
    Since:
      1.0

  - ### project

    public void project(@DelegatesTo(EclipseProject.class) Closure closure)
    Configures eclipse project information

    For examples see docs for `EclipseProject`

    Since:
      1.0

  - ### project

    public void project(Action<? super EclipseProject> action)
    Configures eclipse project information

    For examples see docs for `EclipseProject`

    Since:
      3.5

  - ### classpath

    public void classpath(@DelegatesTo(EclipseClasspath.class) Closure closure)
    Configures eclipse classpath information

    For examples see docs for `EclipseClasspath`

    Since:
      1.0

  - ### classpath

    public void classpath(Action<? super EclipseClasspath> action)
    Configures eclipse classpath information

    For examples see docs for `EclipseClasspath`

    Since:
      3.5

  - ### wtp

    public void wtp(@DelegatesTo(EclipseWtp.class) Closure closure)
    Configures eclipse wtp information

    For examples see docs for `EclipseWtp`

    Since:
      1.0

  - ### wtp

    public void wtp(Action<? super EclipseWtp> action)
    Configures eclipse wtp information

    For examples see docs for `EclipseWtp`

    Since:
      3.5

  - ### jdt

    public void jdt(@DelegatesTo(EclipseJdt.class) Closure closure)
    Configures eclipse java compatibility information (jdt)

    For examples see docs for `EclipseProject`

    Since:
      1.0

  - ### jdt

    public void jdt(Action<? super EclipseJdt> action)
    Configures eclipse java compatibility information (jdt)

    For examples see docs for `EclipseProject`

    Since:
      3.5

  - ### getSynchronizationTasks

    public TaskDependency getSynchronizationTasks()
    Returns the tasks to be executed before the Eclipse synchronization starts.

    This property doesn't have a direct effect to the Gradle Eclipse plugin's behaviour. It is used, however, by Buildship to execute the configured tasks each time before the user imports the project or before a project synchronization starts.

    Returns:
      the tasks names
    Since:
      5.4

  - ### synchronizationTasks

    public void synchronizationTasks(Object... synchronizationTasks)
    Set tasks to be executed before the Eclipse synchronization.
    Since:
      5.4
    See Also:
      - `getSynchronizationTasks()`

  - ### getAutoBuildTasks

    public TaskDependency getAutoBuildTasks()
    Returns the tasks to be executed during the Eclipse auto-build.

    This property doesn't have a direct effect to the Gradle Eclipse plugin's behaviour. It is used, however, by Buildship to execute the configured tasks each time when the Eclipse automatic build is triggered for the project.

    Returns:
      the tasks names
    Since:
      5.4

  - ### autoBuildTasks

    public void autoBuildTasks(Object... autoBuildTasks)
    Set tasks to be executed during the Eclipse auto-build.
    Since:
      5.4
    See Also:
      - `getAutoBuildTasks()`

  - ### pathVariables

    public void pathVariables(Map<String,File> pathVariables)
    Adds path variables to be used for replacing absolute paths in classpath entries.

    If the beginning of the absolute path of a library or other path-related element matches a value of a variable, a variable entry is used. The matching part of the library path is replaced with the variable name.

    For example see docs for `EclipseModel`

    Parameters:
      `pathVariables` - A map with String->File pairs.
    Since:
      1.0