Hi,

should be simple, but I spent hours trying to get this to work.

my build.gradle retrieves several dependencies

from one of them, I want to execute a method and pass many arguments to that
method. 

I tried several ways and none worked. Often this java error message:

 java.lang.NoClassDefFoundError

Here are the details:
dependencies {
    compile group: 'org.apache.xmlgraphics', name: 'fop', version: '1.0'
    compile group: 'com.kenai.nbpwr', name: 'org-apache-batik-all', version:
'1.7-201002241055'
    compile group: 'avalon-framework', name: 'avalon-framework-api',
version: '4.2.0'
    compile group: 'commons-io', name: 'commons-io', version: '1.3.1'
    compile group: 'xalan', name: 'xalan', version: '2.7.0'
    compile group: 'xerces', name: 'xercesImpl', version: '2.7.1'
    compile group: 'xml-apis', name: 'xml-apis', version: '1.3.04'
    compile group: 'xml-apis', name: 'xml-apis-ext', version: '1.3.04'
}

//  try#1
task(createPDF, dependsOn: 'classes', type: JavaExec) {
        main = 'org.apache.fop.cli.Main'
        args '-r -d -xml doc/Loan.xml -xsl xsl/fo/docbook.xsl -pdf
doc/Guide_utilisateur.pdf'
}

and I also try with the plugin: application, the method was called but I was
not able to pass any arguments.

I think the main problem is to tell gradle the runtimeClasspath....

Any idea how to solve that kind of problem?

Thanks a lot.

P.S. gradle build is working fine, as well as executing a Main method from a
.jar file generated by gradle.



--
View this message in context: 
http://gradle.1045684.n5.nabble.com/how-to-call-execute-a-java-method-with-arguments-from-a-dependency-jar-tp5019176p5019176.html
Sent from the gradle-user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to