simplicityitself / grails-gwt

New Grails GWT Plugin
Other
23 stars 18 forks source link

Plugin doesn't support grails 2.3 #24

Closed lyhcode closed 10 years ago

lyhcode commented 10 years ago

Mac OS X 64bit 10.8.5 JDK 7u45 Grails 2.3.1

BuildConfig.groovy configured grails-gwt-plugin 0.9.1 with gwt 2.5.1.

Following message shown after execute "grails compile" command.

Please help.

| Environment set to development.....
Checking GWT home version[2.5.1] buildconfig[null] sysprop[null] antprop[null]
Gwt version 2.5.1 requested, downloading required dependencies
| Error Error loading event script from file [/Users/lyhcode/koobe/KoobeGlobalEditor/target/work/plugins/gwt-0.9.1/scripts/_Events.groovy] No such property: resolveEngine for class: org.codehaus.groovy.grails.resolve.maven.aether.AetherDependencyManager (Use --stacktrace to see the full trace)
| Application cleaned.
daviddawson commented 10 years ago

The plugin at version 0.9.1 is not compatible with Grails 2.3+ at the moment. This is being added in, as it needs to support the new Aether dependency resolution library instead of Ivy.

Soon ..

On 5 November 2013 16:23, Yan-hong Lin notifications@github.com wrote:

Mac OS X 64bit 10.8.5 JDK 7u45 Grails 2.3.1

BuildConfig.groovy configured grails-gwt-plugin 0.9.1 with gwt 2.5.1.

Following message shown after execute "grails compile" command.

Please help.

| Environment set to development..... Checking GWT home version[2.5.1] buildconfig[null] sysprop[null] antprop[null] Gwt version 2.5.1 requested, downloading required dependencies | Error Error loading event script from file [/Users/lyhcode/koobe/KoobeGlobalEditor/target/work/plugins/gwt-0.9.1/scripts/_Events.groovy] No such property: resolveEngine for class: org.codehaus.groovy.grails.resolve.maven.aether.AetherDependencyManager (Use --stacktrace to see the full trace) | Application cleaned.

— Reply to this email directly or view it on GitHubhttps://github.com/simplicityitself/grails-gwt/issues/24 .

donbeave commented 10 years ago

Hello, David!

I just sent pull request with changes from Osian Hughes fork, he already realized maven support.

Please, check it: https://github.com/simplicityitself/grails-gwt/pull/26

daviddawson commented 10 years ago

Great, thanks. I used it as inspiration to complete work that supports grails 2-> 2.3

Try the 1.0-SNAPSHOT that is now available.

donbeave commented 10 years ago
Dependency Manager - Aether
Checking GWT home version[2.5.1] buildconfig[null] sysprop[null] antprop[null]
Gwt version 2.5.1 requested, downloading required dependencies
| Error Error loading event script from file [/Users/BeaVe/JavaProjects/polusharie/target/work/plugins/gwt-1.0-SNAPSHOT/scripts/_Events.groovy] org.sonatype.aether.graph.Dependency (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.ClassNotFoundException: org.sonatype.aether.graph.Dependency
    at _AetherDependencies_groovy.getDeps(_AetherDependencies_groovy:31)
    at _AetherDependencies_groovy$_run_closure2.doCall(_AetherDependencies_groovy:11)
    at _AetherDependencies_groovy$_run_closure2.doCall(_AetherDependencies_groovy)
    at _GwtInternal_groovy.addGwtCoreToDependencies(_GwtInternal_groovy:690)
    at _GwtInternal_groovy$addGwtCoreToDependencies$1.callCurrent(Unknown Source)
    at _GwtInternal_groovy.resolveHome(_GwtInternal_groovy:666)
    at _GwtInternal_groovy$resolveHome$0.callCurrent(Unknown Source)
    at _GwtInternal_groovy.run(_GwtInternal_groovy:51)
    at _GwtInternal_groovy$run.call(Unknown Source)
    at _GrailsSettings_groovy$run.call(Unknown Source)
    at org.codehaus.gant.IncludeTargets.leftShift(IncludeTargets.groovy:59)
    at org.codehaus.gant.IncludeTargets$leftShift.call(Unknown Source)
    at _Events.run(_Events.groovy:1)
    at _GrailsEvents_groovy.run(_GrailsEvents_groovy:49)
    at _GrailsEvents_groovy$run.call(Unknown Source)
    at _GrailsClean_groovy$run.call(Unknown Source)
    at org.codehaus.gant.IncludeTargets.leftShift(IncludeTargets.groovy:59)
    at org.codehaus.gant.IncludeTargets$leftShift.call(Unknown Source)
    at _GrailsClean_groovy.run(_GrailsClean_groovy:29)
    at _GrailsClean_groovy$run.call(Unknown Source)
    at _PluginDependencies_groovy$run.call(Unknown Source)
    at org.codehaus.gant.IncludeTargets.leftShift(IncludeTargets.groovy:59)
    at org.codehaus.gant.IncludeTargets$leftShift.call(Unknown Source)
    at _PluginDependencies_groovy.run(_PluginDependencies_groovy:30)
    at _PluginDependencies_groovy$run.call(Unknown Source)
    at org.codehaus.gant.IncludeTargets.leftShift(IncludeTargets.groovy:59)
    at org.codehaus.gant.IncludeTargets$leftShift.call(Unknown Source)
    at RefreshDependencies.run(RefreshDependencies.groovy:29)
    at RefreshDependencies$run.call(Unknown Source)
    at gant.Gant.prepareTargets(Gant.groovy:607)
| Error Error loading event script from file [/Users/BeaVe/JavaProjects/polusharie/target/work/plugins/gwt-1.0-SNAPSHOT/scripts/_Events.groovy] org.sonatype.aether.graph.Dependency
| Dependencies refreshed.

My configuration is: Grails 2.3.3 compile ':extended-dependency-manager:0.5.1' compile ':gwt:1.0-SNAPSHOT'

daviddawson commented 10 years ago

The aether version used between 2.3.0 and 2.3.3 was changed.
The package changed from org.sonatype to org.eclipse (took me a while to realise what was going on..)

I've got this working now and I'll push fixes up shortly.

daviddawson commented 10 years ago

New GWT plugin snapshot and supporting extended dep manager.

My testing projects now work with :-

Ensure that no gwt plugin snapshot is in maven local repo.

Then in BuildConfig

   build ":extended-dependency-manager:0.5.2"
   compile ":gwt:1.0-SNAPSHOT", {
          transitive=false
   }

Make sure your project is cleaned out

grails refresh-dependencies
grails compile
grails compile-gwt-modules.

This then runs cleanly in a grails 2.3.3 application.

/cc @donbeave

donbeave commented 10 years ago

There is some problems, too.

1) Ivy config:

BeaVes-MacBook-Pro:polusharie BeaVe$ grails compile-gwt-modules
| Environment set to development.....
Dependency Manager - Ivy
Checking GWT home version[2.5.1] buildconfig[null] sysprop[null] antprop[null]
Gwt version 2.5.1 requested, downloading required dependencies
Adding lib/gwt/* to the GWT classpath
Dependency Manager - Ivy
Ivy Extended Dependency resolution has errors, exiting

2) Maven config:

BeaVes-MacBook-Pro:polusharie BeaVe$ grails compile-gwt-modules
| Environment set to development.....
Dependency Manager - Aether
Checking GWT home version[2.5.1] buildconfig[null] sysprop[null] antprop[null]
Gwt version 2.5.1 requested, downloading required dependencies
Adding lib/gwt/* to the GWT classpath
COMPILE START
Adding lib/gwt/* to the GWT classpath
Adding gwt-user-2.5.1.jar to classpath
Adding gwt-servlet-2.5.1.jar to classpath
Adding gwt-codeserver-2.5.1.jar to classpath
Adding json-20090211.jar to classpath
Adding validation-api-1.0.0.GA-sources.jar to classpath
Adding validation-api-1.0.0.GA.jar to classpath
Adding validation-api-1.0.0.GA-sources.jar to classpath
Adding validation-api-1.0.0.GA.jar to classpath
| Compiling 10 source files
…

Plugin ignores all dependencies from GWT Config:

gwt {
…
  dependencies = [
      'com.gwtplatform:gwtp-mvp-client:1.0.3',
      'com.gwtplatform:gwtp-clients-common:1.0.3',
      'com.github.gwtbootstrap:gwt-bootstrap:2.3.2.0-SNAPSHOT',
      'org.apache.velocity:velocity:1.7',
      'org.vectomatic:lib-gwt-file:0.3.4',
      'com.googlecode.gwt-crypto:gwt-crypto:2.3.0'
  ]
}
daviddawson commented 10 years ago

Hmm, ok. is this grails 2.3.3?

I note the Ivy manager in use. I'll go back and retest that.

Thanks @donbeave

donbeave commented 10 years ago

Grails 2.3.4

daviddawson commented 10 years ago

Thanks @donbeave

I've done a refresh of the dependency handling and validated against ivy too.

  build ":extended-dependency-manager:0.5.5"
  compile ":gwt:1.0-SNAPSHOT", {
      transitive=false
  }

Again, you'll have to make sure the snapshot isn't being stored. Note the update to the dep-manager plugin....

donbeave commented 10 years ago

Thanks @daviddawson It's worked now. But still has problems. Very-very slow, slower then previous version of plugin.

It's my compilation process (about 7-8 minutes, a lot time spend it pre-compile process):

| Environment set to production.....
Dependency Manager - Aether
Checking GWT home version[2.5.1] buildconfig[null] sysprop[null] antprop[null]
Gwt version 2.5.1 requested, downloading required dependencies
Adding lib/gwt/* to the GWT classpath
| Packaging Grails application
COMPILE START          

<--- WAIT: ~1 min --->

Added Google Gin 2.0.0 to GWT environment          

<--- WAIT: ~50 sec --->

| Packaging Grails application..
Adding lib/gwt/* to the GWT classpath
Adding gwt-user-2.5.1.jar to classpath
Adding gwt-servlet-2.5.1.jar to classpath
Adding gwt-codeserver-2.5.1.jar to classpath
Adding json-20090211.jar to classpath
Adding validation-api-1.0.0.GA-sources.jar to classpath
Adding validation-api-1.0.0.GA.jar to classpath
Adding validation-api-1.0.0.GA-sources.jar to classpath
Adding validation-api-1.0.0.GA.jar to classpath
Adding gin-2.0.0.jar to classpath
Adding guice-3.0.jar to classpath
Adding guice-assistedinject-3.0.jar to classpath
Adding javax.inject-1.jar to classpath
Adding aopalliance-1.0.jar to classpath
Adding gwtp-mvp-client-1.1.jar to classpath
Adding gwtp-clients-common-1.1.jar to classpath
Adding gwt-bootstrap-2.3.2.0-SNAPSHOT.jar to classpath
Adding velocity-1.7.jar to classpath
Adding lib-gwt-file-0.3.4.jar to classpath
Adding gwt-crypto-2.3.0.jar to classpath
| Compiling 10 source files

| Compiling 302 source files          

<--- WAIT: ~38 sec --->

warning: Implicitly compiled files were not subject to annotation processing.
  Use -proc:none to disable annotation processing or -implicit to specify a policy for implicit compilation.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
| Compiling 131 source files

| Compiling 131 source files.
Added Google Gin 2.0.0 to GWT environment

<--- WAIT: ~1 min --->

| Compiling 131 source files.....
Added Google Gin 2.0.0 to GWT environment
| Compiling GWT modules
Auto configuring to use all of the 24 available hardware threads
Using GWT JS Style OBF
Will compile 1 modules
Selected GWT Worker parallel compilation with 24 worker threads
  Compiling com.polusharie.Polusharie
   module com.polusharie.Polusharie SUCCEEDED
Compilation run completed in 81.218 seconds
| Done creating WAR target/polusharie-0.1.war
daviddawson commented 10 years ago

Cool @donbeave

I call it progress. The switch to support both aether and ivy has been a bit traumatic to the code, so its doing a full resolution for each and every library.

I can see what can be done to optimise it back again, I'll do a full 1.0 release over the next couple of days in any case.

David.

daviddawson commented 10 years ago

Fixed in the 1.0 release, although still running slowly.