mehandih / grails-jaxrs

Automatically exported from code.google.com/p/grails-jaxrs
0 stars 0 forks source link

grails-jaxrs doesn't work with grails-2.2.1 #74

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I'm fairly new to grails.

What steps will reproduce the problem?

Follow the instructions on 
http://code.google.com/p/grails-jaxrs/wiki/GettingStarted

1. Create a fresh project with grails 2.2.1
2. Modify BuildConfig.groovy to add

        mavenRepo "http://maven.restlet.org/"

to repositories and

        compile ":jaxrs:0.7"

to plugins.

(Because "grails install-plugin jaxrs" produces a deprecation warning:

| Warning The install-plugin command is deprecated and may be removed from a 
future version of Grails.  Plugin dependencies should be expressed in 
grails-app/conf/BuildConfig.groovy.  See 
http://grails.org/doc/2.2.x/guide/conf.html#pluginDependencies.

...though I have tried running it too.
)

3. Run "grails create-resource test"

grails> create-resource test
| Compiling 175 source files

| Compiling 175 source files.
| Error Compilation error: startup failed:
/Users/neil/.grails/2.2.1/projects/grails-jaxrs/plugins/jaxrs-0.7/src/groovy/org
/grails/jaxrs/itest/IntegrationTestSpec.groovy: 5: unable to resolve class 
spock.lang.Shared
 @ line 5, column 1.
   import spock.lang.Shared
   ^

/Users/neil/.grails/2.2.1/projects/grails-jaxrs/plugins/jaxrs-0.7/src/groovy/org
/grails/jaxrs/itest/IntegrationTestSpec.groovy: 3: unable to resolve class 
grails.plugin.spock.IntegrationSpec
 @ line 3, column 1.
   import grails.plugin.spock.IntegrationSpec
   ^

/Users/neil/.grails/2.2.1/projects/grails-jaxrs/plugins/jaxrs-0.7/src/groovy/org
/grails/jaxrs/itest/IntegrationTestSpec.groovy: 12: unable to resolve class 
grails.plugin.spock.IntegrationSpec 
 @ line 12, column 1.
   abstract class IntegrationTestSpec extends IntegrationSpec implements JaxRsIntegrationTest {
   ^

/Users/neil/.grails/2.2.1/projects/grails-jaxrs/plugins/jaxrs-0.7/src/groovy/org
/grails/jaxrs/itest/IntegrationTestSpec.groovy: 16: unable to resolve class 
spock.lang.Shared ,  unable to find class for annotation
 @ line 16, column 5.
       @Shared
       ^

/Users/neil/.grails/2.2.1/projects/grails-jaxrs/plugins/jaxrs-0.7/src/groovy/org
/grails/jaxrs/itest/IntegrationTestSpec.groovy: 19: unable to resolve class 
spock.lang.Shared ,  unable to find class for annotation
 @ line 19, column 5.
       @Shared
       ^

5 errors
| Error Error running script create-resource test: 
org.codehaus.groovy.grails.cli.ScriptExitException (Use --stacktrace to see the 
full trace)

What version of the product are you using? On what operating system?

Using grails 2.2.1 on Mac OS X 10.8.3.

randan:~ neil$ groovy -version
Groovy Version: 2.1.1 JVM: 1.6.0_43 Vendor: Apple Inc. OS: Mac OS X
randan:~ neil$ grails -version

Grails version: 2.2.1
randan:~ neil$ java -version
java version "1.6.0_43"
Java(TM) SE Runtime Environment (build 1.6.0_43-b01-447-11M4203)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01-447, mixed mode)
randan:~ neil$ 

Tried various things including refreshing dependencies, adding spock as an 
explicit dependency, adding spock as an explicit dependency with (weirdly) the 
grails support excluded...

    test(":spock:0.7") {
      exclude "spock-grails-support"
    }

...as detailed on http://grails.org/plugin/spock.

Tried checking out the source from git and building it myself, but it wanted an 
older version of grails. So I ran 'grails upgrade' and then 'grails test-app' 
and it failed with a bunch of missing dependencies:

randan:grails-jaxrs neil$ grails test-app
| Application expects grails version [2.1.1], but GRAILS_HOME is version 
[2.2.1] - use the correct Grails version or run 'grails upgrade' if this Grails 
version is newer than the version your application expects.
randan:grails-jaxrs neil$ grails upgrade
| NOTE: Your application currently expects grails version [2.1.1], this target 
will upgrade it to Grails 2.2.1
> 
        WARNING: This target will upgrade an older Grails application to 2.2.1.
        Are you sure you want to continue?
                   [y,n] y
| Project upgraded
randan:grails-jaxrs neil$ grails test-app
| Downloading: wagon-http-shared-1.0-beta-6.jar.sha1
:: problems summary ::
:::: WARNINGS
        [NOT FOUND  ] classworlds#classworlds;1.1-alpha-2!classworlds.jar (0ms)
    ==== localMavenResolver: tried
      /Users/neil/.m2/repository/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.jar
        [NOT FOUND  ] org.codehaus.plexus#plexus-container-default;1.0-alpha-9-stable-1!plexus-container-default.jar (0ms)
    ==== localMavenResolver: tried
      /Users/neil/.m2/repository/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar
        [NOT FOUND  ] org.codehaus.plexus#plexus-utils;1.5.15!plexus-utils.jar (0ms)
    ==== localMavenResolver: tried
      /Users/neil/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar
        [NOT FOUND  ] backport-util-concurrent#backport-util-concurrent;3.1!backport-util-concurrent.jar (0ms)
    ==== localMavenResolver: tried
      /Users/neil/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
        [NOT FOUND  ] nekohtml#xercesMinimal;1.9.6.2!xercesMinimal.jar (0ms)
    ==== localMavenResolver: tried
      /Users/neil/.m2/repository/nekohtml/xercesMinimal/1.9.6.2/xercesMinimal-1.9.6.2.jar
        [NOT FOUND  ] nekohtml#nekohtml;1.9.6.2!nekohtml.jar (0ms)
    ==== localMavenResolver: tried
      /Users/neil/.m2/repository/nekohtml/nekohtml/1.9.6.2/nekohtml-1.9.6.2.jar
        ::::::::::::::::::::::::::::::::::::::::::::::
        ::              FAILED DOWNLOADS            ::
        :: ^ see resolution messages for details  ^ ::
        ::::::::::::::::::::::::::::::::::::::::::::::
        :: classworlds#classworlds;1.1-alpha-2!classworlds.jar
        :: org.codehaus.plexus#plexus-container-default;1.0-alpha-9-stable-1!plexus-container-default.jar
        :: org.codehaus.plexus#plexus-utils;1.5.15!plexus-utils.jar
        :: backport-util-concurrent#backport-util-concurrent;3.1!backport-util-concurrent.jar
        :: nekohtml#xercesMinimal;1.9.6.2!xercesMinimal.jar
        :: nekohtml#nekohtml;1.9.6.2!nekohtml.jar
        ::::::::::::::::::::::::::::::::::::::::::::::

| Error Failed to install plugin [release-2.2.0]. Plugin has missing JAR 
dependencies.
| Downloading: wagon-http-shared-1.0-beta-6.jar.sha1.
randan:grails-jaxrs neil$ 

Gave up.

Original issue reported on code.google.com by nasal...@gmail.com on 23 Mar 2013 at 2:14

GoogleCodeExporter commented 8 years ago
A quick follow-up... I was able to get it working.

I added the spock plugin as an explicit dependency, to BuildConfig.groovy, 
using the instructions on the spock plugin page 
(http://grails.org/plugin/spock). I'd tried this before, but had accidentally 
missed out adding the extra config line to the dependencies section, required 
when using Groovy 2.0.

I can now successfully create a test resource.

Original comment by nasal...@gmail.com on 24 Mar 2013 at 9:08

GoogleCodeExporter commented 8 years ago
This seems also tied to the issues raised in 
https://code.google.com/p/grails-jaxrs/issues/detail?id=72

Looks like the introduction of the Spock plugin dependency isn't a one-version 
fits all.

Original comment by n...@10ne.org on 28 Mar 2013 at 12:10

GoogleCodeExporter commented 8 years ago
Should we go for dynamically choose different dependencies based on grails 
version (if feasible)?
Or is it better tying plugin versions to grails/groovy ones (i.e 0.7 works with 
grails <=2.1, 0.8 for grails 2.2+ and so on?)  

Original comment by davide.cavestro on 29 Mar 2013 at 9:29

GoogleCodeExporter commented 8 years ago
+1 for a new 0.8 release supporting Grails 2.2.x only. For bug fixes, we anyway 
have then both, a 0.7 and a 0.8 branch on github, from which we can release 
0.7.x and 0.8.x bugfix releases. For 0.9 we could aim at supporting dynamic 
dependency resolution.

Thoughts?

Original comment by krass...@googlemail.com on 30 Mar 2013 at 6:50

GoogleCodeExporter commented 8 years ago
I agree with Martin: keeping it simple is better.

Original comment by davide.cavestro on 30 Mar 2013 at 2:40

GoogleCodeExporter commented 8 years ago
I agree

Original comment by n...@10ne.org on 2 Apr 2013 at 10:29

GoogleCodeExporter commented 8 years ago
Newly released version 0.8 
(https://github.com/krasserm/grails-jaxrs/wiki/Release-notes-for-grails-jaxrs-ve
rsion-0.8) should now be properly compatible.
Please note that 0.8 cannot be installed via the install-plugin command.

Original comment by n...@10ne.org on 25 Apr 2013 at 7:09

GoogleCodeExporter commented 8 years ago

Original comment by n...@10ne.org on 25 Apr 2013 at 7:10