Closed harschware closed 12 years ago
To rule out side effects from my build I created a build.gradle containing only the suggested code from the README.md. I get the same error.
hmm...strange. Do you have a complete stacktrace? This does not show any of my code. Just put -s on the gradle command line.
I just tested again, this time on my fairly virgin Mac Book Pro (previous test was on Win7 box). I got the output below. Do you maybe have some environment in your .gradle/init.gradle or something?
Tims-MacBook-Pro:gradle-license-test tharsch$ gradle build -s Download http://repo1.maven.org/maven2/net/nisgits/gradle/gradle-executable-jar-plugin/master-REL-5/gradle-executable-jar-plugin-master-REL-5.pom Download http://repo1.maven.org/maven2/net/nisgits/gradle/gradle-executable-jar-plugin/master-REL-5/gradle-executable-jar-plugin-master-REL-5.jar
FAILURE: Build failed with an exception.
BUILD FAILED
Total time: 4.744 secs
One more peg point for you: Running this gradle.build with gradle-M6 works, with M7 fails for the CommonsHttpClientResolver problem. Note this build is using REL-4. If I attempt to use REL-5 with gradle M6 it fails same as with M7.
apply plugin: 'executable-jar'
mainClass = 'call.with.Main'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'net.nisgits.gradle:gradle-executable-jar-plugin:master-REL-4'
}
}
Sorry about this. I have managed to build the release with a milestone-8 snapshot release of gradle. A new version (master-REL-6) built with milestone-7 is on it way up to Maven Central.
No problem, thanks for the great plugin.
I try apply == > apply plugin: 'executable-jar' in my script . After executing below script, jar file generated successfully inside /build/libs. when I try to run the jar file I'm getting
Exception in thread "main" java.lang.NoClassDefFoundError: groovy/lang/GroovyObject at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at com.simontuffs.onejar.JarClassLoader.defineClass(JarClassLoader.java:803) at com.simontuffs.onejar.JarClassLoader.findClass(JarClassLoader.java:710)
apply plugin: 'executable-jar'
mainClass = 'hello'
buildscript { repositories { mavenCentral() } dependencies {
classpath 'net.nisgits.gradle:gradle-executable-jar-plugin:master-REL-6' , 'org.codehaus.groovy:groovy-all:1.7.10'
} }
I'm running the jar with
java -jar
Not sure what was the the problem.
Is this an application written in Groovy? Remember that the dependencies
section inside the buildscript
section is only for running the executable-jar plugin and won't be included in the resulting jar file.
And could you please move this to a new issue?
After adding the snippet from the README my otherwise working build produces the following error.