anchor.diff:  
   The plugin provides objects modeling the sections of the metadata files that are generated by Gradle. The generation lifecycle is as follows:
   
  -. The file is read; or a default version provided by Gradle is used if it does not exist
  -. The `beforeMerged` hook is executed with a domain object representing the existing file
  -. The existing content is merged with the configuration inferred from the Gradle build or defined explicitly in the eclipse DSL
  -. The `whenMerged` hook is executed with a domain object representing contents of the file to be persisted
  -. The `withXml` hook is executed with a raw representation of the XML that will be persisted
  -. The final XML is persisted
  - The following table lists the domain object used for each of the model types:
  + 1. The file is read; or a default version provided by Gradle is used if it does not exist
  + 2. The `beforeMerged` hook is executed with a domain object representing the existing file
  + 3. The existing content is merged with the configuration inferred from the Gradle build or defined explicitly in the eclipse DSL
  + 4. The `whenMerged` hook is executed with a domain object representing contents of the file to be persisted
  + 5. The `withXml` hook is executed with a raw representation of the XML that will be persisted
  + 6. The final XML is persisted
  +
  +The following are the domain objects used for each of the model types:
   
   [[idea-hooks]]
  -.Idea plugin hooks
  -[cols="a,a,a,a", options="header"]
  -|===
  -| Model
  -| `beforeMerged { arg -> }` argument type
  -| `whenMerged { arg -> }` argument type
  -| `withXml { arg -> }` argument type
  -
  -| api:org.gradle.plugins.ide.idea.model.IdeaProject[]
  -| api:org.gradle.plugins.ide.idea.model.Project[]
  -| api:org.gradle.plugins.ide.idea.model.Project[]
  -| api:org.gradle.api.XmlProvider[]
  -
  -| api:org.gradle.plugins.ide.idea.model.IdeaModule[]
  -| api:org.gradle.plugins.ide.idea.model.Module[]
  -| api:org.gradle.plugins.ide.idea.model.Module[]
  -| api:org.gradle.api.XmlProvider[]
  -
  -| api:org.gradle.plugins.ide.idea.model.IdeaWorkspace[]
  -| api:org.gradle.plugins.ide.idea.model.Workspace[]
  -| api:org.gradle.plugins.ide.idea.model.Workspace[]
  -| api:org.gradle.api.XmlProvider[]
  -|===
  +api:org.gradle.plugins.ide.idea.model.IdeaProject[]::
  ++
  + * `beforeMerged { api:org.gradle.plugins.ide.idea.model.Project[] arg \-> ... }`
  + * `whenMerged { api:org.gradle.plugins.ide.idea.model.Project[] arg \-> ... }`
  + * `withXml { api:org.gradle.api.XmlProvider[] arg \-> ... }`
  +
  +api:org.gradle.plugins.ide.idea.model.IdeaModule[]::
  + * `beforeMerged { api:org.gradle.plugins.ide.idea.model.Module[] arg \-> ... }`
  + * `whenMerged { api:org.gradle.plugins.ide.idea.model.Module[] arg \-> ... }`
  + * `withXml { api:org.gradle.api.XmlProvider[] arg \-> ... }`
  +
  +api:org.gradle.plugins.ide.idea.model.IdeaWorkspace[]::
  + * `beforeMerged { api:org.gradle.plugins.ide.idea.model.Workspace[] arg \-> ... }`
  + * `whenMerged { api:org.gradle.plugins.ide.idea.model.Workspace[] arg \-> ... }`
  + * `withXml { api:org.gradle.api.XmlProvider[] arg \-> ... }`
   
   
   [[sec:partial-rewrite]]
   ===== Partial rewrite of existing content
   
   A <<sec:complete-rewrite,complete rewrite>> causes all existing content to be discarded, thereby losing any changes made directly in the IDE. The `beforeMerged` hook makes it possible to overwrite just certain parts of the existing content. The following example removes all existing dependencies from the `Module` domain object:
  +
   ++++
   <sample id="partialRewrites" dir="idea" title="Partial Rewrite for Module">
  -                        <sourcefile file="build.gradle" snippet="module-before-merged"/>
  -                    </sample>
  +    <sourcefile file="build.gradle" snippet="module-before-merged"/>
  +</sample>
   ++++
   
   The resulting module file will only contain Gradle-generated dependency entries, but not any other dependency entries that may have been present in the original file. (In the case of dependency entries, this is also the default behavior.) Other sections of the module file will be either left as-is or merged. The same could be done for the module paths in the project file:
   
   ++++
   <sample id="partialRewritesProject" dir="idea" title="Partial Rewrite for Project">
  -                        <sourcefile file="build.gradle" snippet="project-before-merged"/>
  -                    </sample>
  +    <sourcefile file="build.gradle" snippet="project-before-merged"/>
  +</sample>
   ++++
   
   
  
positive.code: 
  The IDEA plugin generates files that are used by http://www.jetbrains.com/idea/[IntelliJ IDEA], thus making it possible to open the project from IDEA (`File` - `Open Project`). Both external dependencies (including associated source and Javadoc files) and project dependencies are considered.
  
  What exactly the IDEA plugin generates depends on which other plugins are used:
  
  .IDEA plugin behavior
  [cols="a,a", options="header"]
  |===
  | Plugin
  | Description
  
  | None
  | Generates an IDEA module file. Also generates an IDEA project and workspace file if the project is the root project.
  
  | <<java_plugin,Java>>
  | Adds Java configuration to the module and project files.
  |===
  
  One focus of the IDEA plugin is to be open to customization. The plugin provides a standardized set of hooks for adding and removing content from the generated files.
  
  
negative.code: The IDEA plugin adds the tasks shown below to a project. Notice that the `clean` task does not depend on the `cleanIdeaWorkspace` task. This is because the workspace typically contains a lot of user specific temporary data and it is not desirable to manipulate it outside IDEA.
  
  [[ideatasks]]
  `idea` — depends on: `ideaProject`, `ideaModule`, `ideaWorkspace`::
  Generates all IDEA configuration files
  
  `openIdea` — depends on: `idea`::
  Generates all IDEA configuration files and opens the project in IDEA
  
  `cleanIdea` — type: api:org.gradle.api.tasks.Delete[], depends on: `cleanIdeaProject`, `cleanIdeaModule`::
  Removes all IDEA configuration files
  
  `cleanIdeaProject` — type: api:org.gradle.api.tasks.Delete[]::
  Removes the IDEA project file
  
  `cleanIdeaModule` — type: api:org.gradle.api.tasks.Delete[]::
  Removes the IDEA module file
  
  `cleanIdeaWorkspace` — type: api:org.gradle.api.tasks.Delete[]::
  Removes the IDEA workspace file
  
  `ideaProject` — type: api:org.gradle.plugins.ide.idea.GenerateIdeaProject[]::
  Generates the `.ipr` file. This task is only added to the root project.
  
  `ideaModule` — type: api:org.gradle.plugins.ide.idea.GenerateIdeaModule[]::
  Generates the `.iml` file
  
  `ideaWorkspace` — type: api:org.gradle.plugins.ide.idea.GenerateIdeaWorkspace[]::
  Generates the `.iws` file. This task is only added to the root project.
  
  
  [[sec:idea_configuration]]
  