Done : http://forums.gradle.org/gradle/topics/application_plugin_cannot_run_the_application_after_gradle_startscripts_must_run_gradle_installapp_before?rfm=1
Also, did a pull request : https://github.com/gradle/gradle/pull/146 Thansk, Marc Le 2013-04-13 à 13:03, Daz DeBoer <darrell.deb...@gradleware.com> a écrit : > Hi Marc > Can you please raise this on forums.gradle.org. That way the any > discussion is easily accessible to anyone else who might be > experiencing the same problem. > We also have good integration that allows us to escalate a forum issue > to Jira, if it proves to be a legitimate bug. > Thanks > Daz > > On 13 April 2013 10:07, Marc Paquette <mar...@mac.com> wrote: >> Hello all, >> >> I'm reading "Gradle Effective Implementation Guide" by mrhaki and I = >> noticed a small hiccup in the application plugin. >> >> With this build file: >> >> apply plugin: 'java' >> apply plugin: 'application' >> archivesBaseName =3D 'gradle.sample' >> version =3D '1.0' >> mainClassName =3D 'gradle.sample.SampleApp' >> >> running "gradle startScripts" will compile and create the jar = >> 'build/libs/gradle.sample-1.0.jar' and the scripts = >> 'build/scripts/chapter6' and 'build/scripts/chapter6.bat'. >> >> The problem is that the scripts generated refer to the 'lib' (note no = >> trailing 's') directory and thus trying to run them at that point fails: >> >> [marcpa@moliere-wifi chapter6]$ gradle --build-file appPlugin.gradle = >> clean startScripts >> Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=3DUTF-8 >> :clean >> :compileJava >> :processResources >> :classes >> :jar >> :startScripts >> >> BUILD SUCCESSFUL >> >> Total time: 1.503 secs >> [marcpa@moliere-wifi chapter6]$ ./build/scripts/chapter6 >> Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=3DUTF-8 >> Exception in thread "main" java.lang.NoClassDefFoundError: = >> gradle/sample/SampleApp >> Caused by: java.lang.ClassNotFoundException: gradle.sample.SampleApp >> at java.net.URLClassLoader$1.run(URLClassLoader.java:202) >> at java.security.AccessController.doPrivileged(Native Method) >> at java.net.URLClassLoader.findClass(URLClassLoader.java:190) >> at java.lang.ClassLoader.loadClass(ClassLoader.java:306) >> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) >> at java.lang.ClassLoader.loadClass(ClassLoader.java:247) >> [marcpa@moliere-wifi chapter6]$ >> >> However, if you run 'gradle installApp', then the jar is copied to = >> 'build/install/lib', the scripts to 'build/install/bin' and you can = >> execute the scripts because now the lib subdirectory exists. >> >> Looking at the source of ApplicationPlugin it seems intentional, but I = >> find it confusing to end up with a script that cannot be used to run the = >> application after "gradle startScripts". >> >> Should I open an issue on that ? >> >> Regards, >> Marc Paquette >> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email >> >> > > > > -- > Darrell (Daz) DeBoer > Principal Engineer, Gradleware > http://www.gradleware.com > Join us at the Gradle Summit 2013, June 13th and 14th in Santa Clara, > CA: http://www.gradlesummit.com > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email