# Javadoc including a list of files doesn't work

**URL:** <https://discuss.gradle.org/t/javadoc-including-a-list-of-files-doesnt-work/4128>\
**Category:** Old Forum Archive\
**Created:** [October 8, 2014, 6:29pm UTC](https://discuss.gradle.org/t/javadoc-including-a-list-of-files-doesnt-work/4128 "2014-10-08T18:29:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sky\_Kelsey](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/sky_kelsey/32/822_2.png) [@Sky\_Kelsey](https://discuss.gradle.org/u/Sky_Kelsey)\
**Post date:** [October 8, 2014, 6:29pm UTC](https://discuss.gradle.org/t/javadoc-including-a-list-of-files-doesnt-work/4128/1 "2014-10-08T18:29:00Z")

</div>

[http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.javadoc.Javadoc.html#org.gradle.api.tasks.javadoc.Javadoc:include(groovy.lang.Closure)](http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.javadoc.Javadoc.html#org.gradle.api.tasks.javadoc.Javadoc:include%28groovy.lang.Closure%29)

Here is what I’m doing:

task androidJavadocs(type: Javadoc) {

failOnError = false

classpath += project.files(android.plugin.getBootClasspath().join(File.pathSeparator))

println "Javadoc classpath: " + classpath.asPath

FileCollection publicSource = files(‘src/com/example/Class1.java’,

‘src/com/example/Class2.java’)

include(copySpec {

from ‘source’

into ‘destination’

include { it.file in publicSource }

})

println "Javadoc sources: " + source.asPath

}

What is wrong with this?

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [October 8, 2014, 9:00pm UTC](https://discuss.gradle.org/t/javadoc-including-a-list-of-files-doesnt-work/4128/2 "2014-10-08T21:00:00Z")

</div>

There is no ‘include’ method that takes a ‘CopySpec’. (Where did you get this from?) Have you tried ‘include “com/example/Class1.java”; include …’? Additionally, you’ll need to set ‘source’ (typically to some source set).

PS: Please always include the full error message.
