Using @eric_deandrea 's version I got an exception:
package javax.portlet does not exist
which has resolved by adding the following code to the task:
options.addStringOption("sourcepath", "")
Google did not get me the correct answer, hope this will help others.