Is this just an RTFM question?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Is this just an RTFM question?

Russel Winder-2
In my build.gradle file I have:

        usePlugin ( 'groovy' )
        dependencies {
          addMavenRepo ( )
          groovy
        ( 'org.codehaus.groovy:groovy-all:1.6-beta-2-SNAPSHOT' )
          compile ( 'commons-cli:commons-cli:1.0' )
          testCompile ( 'junit:junit:3.8.2' )
        }
        sourceCompatibility = 1.5
        targetCompatibility = 1.5

However, this fails in two ways, firstly it cannot find the Groovy jars
which is a bit sad as they are definitely in the repository:

|> find /home/users/russel/.m2/repository -name "*groovy-all-1.6*"
/home/users/russel/.m2/repository/org/codehaus/groovy/groovy-all/1.6-beta-2-SNAPSHOT/groovy-all-1.6-beta-2-SNAPSHOT.pom
/home/users/russel/.m2/repository/org/codehaus/groovy/groovy-all/1.6-beta-2-SNAPSHOT/groovy-all-1.6-beta-2-SNAPSHOT-sources.jar
/home/users/russel/.m2/repository/org/codehaus/groovy/groovy-all/1.6-beta-2-SNAPSHOT/groovy-all-1.6-beta-2-SNAPSHOT-javadoc.jar
/home/users/russel/.m2/repository/org/codehaus/groovy/groovy-all/1.6-beta-2-SNAPSHOT/groovy-all-1.6-beta-2-SNAPSHOT.jar
|>

|> gradle compile
Buildfilename: build.gradle
Settings file '/home/users/russel/Repositories/Bazaar/Masters/Gant/Trunk/settings.gradle' is not available. Using an empty script!
No build sources found.
:: loading settings :: url = jar:file:/home/users/russel/lib/Java/gradle/lib/ivy-2.0.0.rc1_20080716132100_r677238.jar!/org/apache/ivy/core/settings/ivysettings.xml
:: resolving dependencies :: org.gradle#build;SNAPSHOT
        confs: [build]
Adding to classpath: /usr/lib/jvm/java-6-openjdk/lib/tools.jar
++ Loading Project objects
++ Configuring Project objects
Project= : evaluated.
++++ Starting build for primary task 'compile'.
Executing: :init
Executing: :resources
Executing: :compile
:: resolving dependencies :: org.codehaus.gant#Trunk;1.5.0-SNAPSHOT
        confs: [compile]
        found commons-cli#commons-cli;1.0 in MavenRepo_poms

:: problems summary ::
:::: WARNINGS
                module not found: org.codehaus.groovy#groovy-all;1.6-beta-2-SNAPSHOT

        ==== clientModule: tried

        ==== build-resolver: tried

          /home/users/russel/Repositories/Bazaar/Masters/Gant/Trunk/.gradle/build-resolver/org.codehaus.groovy/groovy-all/1.6-beta-2-SNAPSHOT/ivys/ivy.xml

          -- artifact org.codehaus.groovy#groovy-all;1.6-beta-2-SNAPSHOT!groovy-all.jar:

          /home/users/russel/Repositories/Bazaar/Masters/Gant/Trunk/.gradle/build-resolver/org.codehaus.groovy/groovy-all/1.6-beta-2-SNAPSHOT/jars/groovy-all.jar

        ==== MavenRepo_poms: tried

          http://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/1.6-beta-2-SNAPSHOT/groovy-all-1.6-beta-2-SNAPSHOT.pom

          -- artifact org.codehaus.groovy#groovy-all;1.6-beta-2-SNAPSHOT!groovy-all.jar:

          http://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/1.6-beta-2-SNAPSHOT/groovy-all-1.6-beta-2-SNAPSHOT.jar

        ==== MavenRepo_jars: tried


:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS

Build aborted abnormally.  Run with -s option to get stacktrace. Run with -d option to get all debug info including stacktrace. Run (additionally) with -f option to get the full (very verbose) stacktrace
Exception: org.gradle.api.GradleException: Build file '/home/users/russel/Repositories/Bazaar/Masters/Gant/Trunk/build.gradle' No line info available from stacktrace.
Not all dependencies could be resolved!

Total time: 4.446 secs
Exit with error!

So why isn't the Maven repository lookup searching the local repository
as well as everything else?

If I downgrade to use Groovy beta 1 then the compilation succeeds but
the test compilation fails.  The JUnit jar is found so why isn't it
added to the classpath?


 |> gradle testCompile
Buildfilename: build.gradle
Settings file '/home/users/russel/Repositories/Bazaar/Masters/Gant/Trunk/settings.gradle' is not available. Using an empty script!
No build sources found.
:: loading settings :: url = jar:file:/home/users/russel/lib/Java/gradle/lib/ivy-2.0.0.rc1_20080716132100_r677238.jar!/org/apache/ivy/core/settings/ivysettings.xml
:: resolving dependencies :: org.gradle#build;SNAPSHOT
        confs: [build]
Adding to classpath: /usr/lib/jvm/java-6-openjdk/lib/tools.jar
++ Loading Project objects
++ Configuring Project objects
Project= : evaluated.
++++ Starting build for primary task 'testCompile'.
Executing: :init
Executing: :resources
Executing: :compile
:: resolving dependencies :: org.codehaus.gant#Trunk;1.5.0-SNAPSHOT
        confs: [compile]
        found org.codehaus.groovy#groovy-all;1.6-beta-1 in MavenRepo_poms
        found commons-cli#commons-cli;1.0 in MavenRepo_poms
Adding to classpath: /usr/lib/jvm/java-6-openjdk/lib/tools.jar
    [mkdir] Created dir: /home/users/russel/Repositories/Bazaar/Masters/Gant/Trunk/build/classes
  [groovyc] Compiling 16 source files to /home/users/russel/Repositories/Bazaar/Masters/Gant/Trunk/build/classes
Executing: :testResources
Executing: :testCompile
:: resolving dependencies :: org.codehaus.gant#Trunk;1.5.0-SNAPSHOT
        confs: [testCompile]
        found org.codehaus.groovy#groovy-all;1.6-beta-1 in MavenRepo_poms
        found commons-cli#commons-cli;1.0 in MavenRepo_poms
        found junit#junit;3.8.2 in MavenRepo_poms
Adding to classpath: /usr/lib/jvm/java-6-openjdk/lib/tools.jar
    [mkdir] Created dir: /home/users/russel/Repositories/Bazaar/Masters/Gant/Trunk/build/test-classes
  [groovyc] Compiling 30 source files to /home/users/russel/Repositories/Bazaar/Masters/Gant/Trunk/build/test-classes
  [groovyc] >>> a serious error occurred: junit/framework/TestCase
  [groovyc] >>> stacktrace:
  [groovyc] java.lang.NoClassDefFoundError: junit/framework/TestCase
  [groovyc] at java.lang.ClassLoader.defineClass1(Native Method)
  [groovyc] at java.lang.ClassLoader.defineClass(ClassLoader.java:637)
  [groovyc] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
  [groovyc] at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
  [groovyc] at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
  [groovyc] at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
  [groovyc] at java.security.AccessController.doPrivileged(Native Method)
  [groovyc] at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
  [groovyc] at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
  [groovyc] at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
  [groovyc] at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:633)
  [groovyc] at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:718)
  [groovyc] at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
  [groovyc] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
  [groovyc] at java.lang.ClassLoader.defineClass1(Native Method)
  [groovyc] at java.lang.ClassLoader.defineClass(ClassLoader.java:637)
  [groovyc] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
  [groovyc] at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
  [groovyc] at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
  [groovyc] at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
  [groovyc] at java.security.AccessController.doPrivileged(Native Method)
  [groovyc] at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
  [groovyc] at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
  [groovyc] at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:633)
  [groovyc] at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:491)
  [groovyc] at org.codehaus.groovy.control.ResolveVisitor.resolveToClass(ResolveVisitor.java:533)
  [groovyc] at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:218)
  [groovyc] at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:847)
  [groovyc] at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:108)
  [groovyc] at org.codehaus.groovy.control.CompilationUnit$5.call(CompilationUnit.java:524)
  [groovyc] at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:770)
  [groovyc] at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:435)
  [groovyc] at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:414)
  [groovyc] at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:63)
  [groovyc] at org.codehaus.groovy.tools.FileSystemCompiler.main(FileSystemCompiler.java:246)
  [groovyc] at org.codehaus.groovy.ant.Groovyc.compile(Groovyc.java:786)
  [groovyc] at org.codehaus.groovy.ant.Groovyc.execute(Groovyc.java:554)
  [groovyc] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
  [groovyc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  [groovyc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  [groovyc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  [groovyc] at java.lang.reflect.Method.invoke(Method.java:616)
  [groovyc] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
  [groovyc] at org.apache.tools.ant.Task.perform(Task.java:348)
  [groovyc] at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:62)
  [groovyc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  [groovyc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  [groovyc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  [groovyc] at java.lang.reflect.Method.invoke(Method.java:616)
  [groovyc] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
  [groovyc] at org.apache.tools.ant.Task.perform(Task.java:348)
  [groovyc] at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:199)
  [groovyc] at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:153)
  [groovyc] at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:149)
  [groovyc] at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
  [groovyc] at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.invoke(PogoMetaClassSite.java:40)
  [groovyc] at org.codehaus.groovy.runtime.callsite.CallSite.call(CallSite.java:126)
  [groovyc] at Script1.run(Script1.groovy:4)
  [groovyc] at groovy.lang.GroovyShell.evaluate(GroovyShell.java:543)
  [groovyc] at groovy.lang.GroovyShell.evaluate(GroovyShell.java:518)
  [groovyc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  [groovyc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  [groovyc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  [groovyc] at java.lang.reflect.Method.invoke(Method.java:616)
  [groovyc] at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
  [groovyc] at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
  [groovyc] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:910)
  [groovyc] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:754)
  [groovyc] at org.codehaus.groovy.runtime.InvokerHelper.invokePojoMethod(InvokerHelper.java:765)
  [groovyc] at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:753)
  [groovyc] at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
  [groovyc] at org.gradle.util.GradleUtil.executeIsolatedAntScript(GradleUtil.groovy:188)
  [groovyc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  [groovyc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  [groovyc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  [groovyc] at java.lang.reflect.Method.invoke(Method.java:616)
  [groovyc] at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
  [groovyc] at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
  [groovyc] at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1102)
  [groovyc] at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:748)
  [groovyc] at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
  [groovyc] at org.gradle.api.tasks.compile.AntGroovyc.execute(AntGroovyc.groovy:54)
  [groovyc] at org.gradle.api.tasks.compile.GroovyCompile.compile(GroovyCompile.java:100)
  [groovyc] at org.gradle.api.tasks.compile.GroovyCompile$1.execute(GroovyCompile.java:73)
  [groovyc] at org.gradle.api.internal.AbstractTask.execute(AbstractTask.java:187)
  [groovyc] at org.gradle.execution.Dag.execute(Dag.java:254)
  [groovyc] at org.gradle.execution.Dag.execute(Dag.java:245)
  [groovyc] at org.gradle.execution.BuildExecuter.execute(BuildExecuter.java:53)
  [groovyc] at org.gradle.Build.runInternal(Build.java:94)
  [groovyc] at org.gradle.Build.run(Build.java:72)
  [groovyc] at org.gradle.Main.main(Main.java:246)
  [groovyc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  [groovyc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  [groovyc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  [groovyc] at java.lang.reflect.Method.invoke(Method.java:616)
  [groovyc] at org.gradle.BootstrapMain.main(BootstrapMain.java:70)
  [groovyc] Caused by: java.lang.ClassNotFoundException: junit.framework.TestCase
  [groovyc] at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
  [groovyc] at java.security.AccessController.doPrivileged(Native Method)
  [groovyc] at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
  [groovyc] at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
  [groovyc] at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
  [groovyc] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
  [groovyc] ... 96 more

Build aborted abnormally.  Run with -s option to get stacktrace. Run with -d option to get all debug info including stacktrace. Run (additionally) with -f option to get the full (very verbose) stacktrace
Exception: org.gradle.api.GradleScriptException: Build file '/home/users/russel/Repositories/Bazaar/Masters/Gant/Trunk/build.gradle' No line info available from stacktrace.
: Compilation Failed

Total time: 15.314 secs
Exit with error!




--
Russel.
====================================================
Dr Russel Winder                 Partner

Concertant LLP                   t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,              f: +44 8700 516 084
London SW11 1EN, UK.             m: +44 7770 465 077

signature.asc (196 bytes) Download Attachment