Explicitly specify the `:sourcepath` parameter for javadoc tool
diff --git a/CHANGELOG b/CHANGELOG
index f5a8f3e..96d7796 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -8,6 +8,8 @@
 * Added:  Detect external annotations in the local project and add them to the generated IntelliJ IDEA
           module when generating. The default location is `src/main/annotations` but other locations
           can be specified by modifying the `project.iml.annotation_paths` property.
+* Fixed:  Explicitly specify the `:sourcepath` parameter for javadoc tool. This enables additional parameters
+          such as `-packagenames` and `-subpackages` to be passed to the underling tool.
 
 1.5.7 (2019-02-16)
 * Fixed:  The fix that allowed special characters in usernames and passwords was only partially applied
diff --git a/lib/buildr/java/doc.rb b/lib/buildr/java/doc.rb
index 123e46a..3dfca28 100644
--- a/lib/buildr/java/doc.rb
+++ b/lib/buildr/java/doc.rb
@@ -24,6 +24,7 @@
         if project.doc.engine? Javadoc
           options = project.doc.options
           options[:windowtitle] = (project.comment || project.name) unless options[:windowtitle]
+          options[:sourcepath] = project.compile.sources.join(File::PATH_SEPARATOR) unless options[:sourcepath]
         end
       end
     end