Class EclipseClasspath
GenerateEclipseClasspath task to generate an Eclipse .classpath file.
 The following example demonstrates the various configuration options. Keep in mind that all properties have sensible defaults; only configure them explicitly if the defaults don't match your needs.
 plugins {
     id 'java'
     id 'eclipse'
 }
 configurations {
   provided
   someBoringConfig
 }
 eclipse {
   //if you want parts of paths in resulting file to be replaced by variables (files):
   pathVariables 'GRADLE_HOME': file('/best/software/gradle'), 'TOMCAT_HOME': file('../tomcat')
   classpath {
     //you can tweak the classpath of the Eclipse project by adding extra configurations:
     plusConfigurations += [ configurations.provided ]
     //you can also remove configurations from the classpath:
     minusConfigurations += [ configurations.someBoringConfig ]
     //if you want to append extra containers:
     containers 'someFriendlyContainer', 'andYetAnotherContainer'
     //customizing the classes output directory:
     defaultOutputDir = file('build-eclipse')
     //default settings for downloading sources and Javadoc:
     downloadSources = true
     downloadJavadoc = false
     //if you want to expose test classes to dependent projects
     containsTestFixtures = true
     //customizing which Eclipse source directories should be marked as test
     testSourceSets = [sourceSets.test]
     //customizing which dependencies should be marked as test on the project's classpath
     testConfigurations = [configurations.testCompileClasspath, configurations.testRuntimeClasspath]
   }
 }
 
 For tackling edge cases, users can perform advanced configuration on the resulting XML file.
 It is also possible to affect the way that the Eclipse plugin merges the existing configuration
 via beforeMerged and whenMerged closures.
 
 The beforeMerged and whenMerged closures receive a Classpath object.
 
Examples of advanced configuration:
 plugins {
     id 'java'
     id 'eclipse'
 }
 eclipse {
   classpath {
     file {
       //if you want to mess with the resulting XML in whatever way you fancy
       withXml {
         def node = it.asNode()
         node.appendNode('xml', 'is what I love')
       }
       //closure executed after .classpath content is loaded from existing file
       //but before gradle build information is merged
       beforeMerged { classpath ->
         //you can tinker with the Classpath here
       }
       //closure executed after .classpath content is loaded from existing file
       //and after gradle build information is merged
       whenMerged { classpath ->
         //you can tinker with the Classpath here
       }
     }
   }
 }
 - 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcontainers(String... containers) Further classpath containers to be added.voidEnables advanced configuration like tinkering with the output XML or affecting the way that the contents of an existing .classpath file is merged with Gradle build information.voidfile(Action<? super XmlFileContentMerger> action) Enables advanced configuration like tinkering with the output XML or affecting the way that the contents of an existing .classpath file is merged with Gradle build information.abstract DirectoryPropertyThe base output directory for source sets.The classpath containers to be added.Returnstrueif the classpath contains test fixture classes that should be visible through incoming project dependencies.The default output directory where Eclipse puts compiled classes.getFile()Seefile(Action).org.gradle.plugins.ide.eclipse.model.internal.FileReferenceFactoryThe configurations whose files are to be excluded from the classpath entries.The configurations whose files are to be added as classpath entries.The source sets to be added.Returns the test configurations.Returns the test source sets.booleanWhether to download and associate Javadoc Jars with the dependency Jars.booleanWhether to download and associate source Jars with the dependency Jars.booleanvoidmergeXmlClasspath(Classpath xmlClasspath) Calculates, resolves and returns dependency entries of this classpath.voidsetClassFolders(List<File> classFolders) voidsetContainers(Set<String> containers) voidsetDefaultOutputDir(File defaultOutputDir) voidsetDownloadJavadoc(boolean downloadJavadoc) voidsetDownloadSources(boolean downloadSources) voidsetFile(XmlFileContentMerger file) voidsetMinusConfigurations(Collection<Configuration> minusConfigurations) voidsetPathVariables(Map<String, File> pathVariables) voidsetPlusConfigurations(Collection<Configuration> plusConfigurations) voidsetProjectDependenciesOnly(boolean projectDependenciesOnly) voidsetSourceSets(Iterable<SourceSet> sourceSets) 
- 
Constructor Details- 
EclipseClasspath
 
- 
- 
Method Details- 
getSourceSetsThe source sets to be added.See EclipseClasspathfor an example.
- 
setSourceSets
- 
getPlusConfigurationsThe configurations whose files are to be added as classpath entries.See EclipseClasspathfor an example.
- 
setPlusConfigurations
- 
getMinusConfigurationsThe configurations whose files are to be excluded from the classpath entries.See EclipseClasspathfor an example.
- 
setMinusConfigurations
- 
getContainersThe classpath containers to be added.See EclipseClasspathfor an example.
- 
setContainers
- 
getDefaultOutputDirThe default output directory where Eclipse puts compiled classes.See EclipseClasspathfor an example.
- 
setDefaultOutputDir
- 
getBaseSourceOutputDirThe base output directory for source sets.See EclipseClasspathfor an example.- Since:
- 8.1
 
- 
isDownloadSourcespublic boolean isDownloadSources()Whether to download and associate source Jars with the dependency Jars. Defaults to true.See EclipseClasspathfor an example.
- 
setDownloadSourcespublic void setDownloadSources(boolean downloadSources) 
- 
isDownloadJavadocpublic boolean isDownloadJavadoc()Whether to download and associate Javadoc Jars with the dependency Jars. Defaults to false.See EclipseClasspathfor an example.
- 
setDownloadJavadocpublic void setDownloadJavadoc(boolean downloadJavadoc) 
- 
getFileSeefile(Action).
- 
setFile
- 
getPathVariables
- 
setPathVariables
- 
isProjectDependenciesOnlypublic boolean isProjectDependenciesOnly()
- 
setProjectDependenciesOnlypublic void setProjectDependenciesOnly(boolean projectDependenciesOnly) 
- 
getClassFolders
- 
setClassFolders
- 
getProject
- 
containersFurther classpath containers to be added.See EclipseClasspathfor an example.- Parameters:
- containers- the classpath containers to be added
 
- 
fileEnables advanced configuration like tinkering with the output XML or affecting the way that the contents of an existing .classpath file is merged with Gradle build information. The object passed to the whenMerged{} and beforeMerged{} closures is of typeClasspath.See EclipseProjectfor an example.
- 
fileEnables advanced configuration like tinkering with the output XML or affecting the way that the contents of an existing .classpath file is merged with Gradle build information. The object passed to the whenMerged{} and beforeMerged{} closures is of typeClasspath.See EclipseProjectfor an example.- Since:
- 3.5
 
- 
resolveDependenciesCalculates, resolves and returns dependency entries of this classpath.
- 
mergeXmlClasspath
- 
getFileReferenceFactorypublic org.gradle.plugins.ide.eclipse.model.internal.FileReferenceFactory getFileReferenceFactory()
- 
getContainsTestFixturesReturnstrueif the classpath contains test fixture classes that should be visible through incoming project dependencies.- Since:
- 6.8
 
- 
getTestSourceSetsReturns the test source sets.The source directories in the returned source sets are marked with the 'test' classpath attribute on the Eclipse classpath. The default value contains the following elements: - All source sets with names containing the 'test' substring (case ignored)
- All source sets defined via the jvm-test-suite DSL
 - Since:
- 7.5
 
- 
getTestConfigurationsReturns the test configurations.All resolved dependencies that appear only in the returned dependency configurations are marked with the 'test' classpath attribute on the Eclipse classpath. The default value contains the following elements: - The compile and runtime configurations of the testSourceSets, including the jvm-test-suite source sets
- Other configurations with names containing the 'test' substring (case ignored)
 Note, that this property should contain resolvable configurations only. - Since:
- 7.5
 
- The compile and runtime configurations of the 
 
-