groovydev / twitter-bootstrap-grails-plugin

Grails plugin for Twitter Bootstrap CSS framework resources
173 stars 92 forks source link

twitter-bootstrap does not work with Grails 2.1.0.RC2 #36

Closed superflav closed 12 years ago

superflav commented 12 years ago

When upgrading to Grails 2.1.0.RC2, twitter-bootstrap plugin version 2.0.2.25 throws "unable to resolve class" errors due to not being able to find org.tmatesoft.svn.*, on which it depends. Version 2.0.1.22 works just fine however.

From digging into each of the two plugin version's pom files on the Grails Repo, I noticed that the 2.0.2.25 version has a dependency on svn, whereas the 2.0.1.22 version does not.

<dependency>
    <groupId>org.grails.plugins</groupId>
    <artifactId>svn</artifactId>
    <version>1.0.2</version>
    <type>zip</type>
    <scope>runtime</scope>
</dependency>

My guess is that the 2.0.2.25 version of the plugin was published using a version of the Grails Release plugin that depended on SVN, and that the SVN dependency somehow made it's way into the pom.

Grails Artifactory-based Repo

http://repo.grails.org/grails/simple/plugins-releases-local/org/grails/plugins/twitter-bootstrap/

How to publish to the new Grails Central Repo

http://grails.github.com/grails-howtos/en/migrateToTheNewCentralRepository.html

Get the latest Grails Release Plugin, which no longer depends on SVN

http://grails.org/plugin/release

To recreate

Create a new app using grails 2.1.0.RC2. Once it's created, install twitter-bootstrap. Version 2.0.1.22 (which is not the latest version) will be downloaded and installed. Then do a grails compile and everything will complete without error.

superflav:~/tmp$ grails 2.1.0.RC2 create-app twooneoh
| Created Grails Application at ~/tmp/twooneoh
superflav:~/tmp$ cd twooneoh/
@superflav:~/tmp/twooneoh$ grails install-plugin twitter-bootstrap
| Downloading: grails-twitter-bootstrap-2.0.1.22.zip
superflav:~/tmp/twooneoh$ grails compile
| Compiling 115 source files
| Compiling 8 source files.

Upgrade to the latest twitter-bootstrap by opening application.properties, and setting plugins.twitter-bootstrap=2.0.2.25 . Once that's done, do a grails compile and you'll get import errors.

superflav:~/tmp/twooneoh$ grails compile
| Environment set to development.....
> You currently already have a version of the plugin installed [twitter-bootstrap-2.0.1.22]. Do you want to update to [twitter-bootstrap-2.0.2.25]? [y,n] y
| Compiling 117 source files
Note: ~/.grails/2.1.0.RC2/projects/twooneoh/plugins/cache-1.0.0.RC1/src/java/grails/plugin/cache/web/GenericResponseWrapper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
| Compiling 117 source files.
| Error Compilation error: startup failed:
~/.grails/2.1.0.RC2/projects/twooneoh/plugins/svn-1.0.2/src/groovy/grails/plugin/svn/SvnClient.groovy: 19: unable to resolve class org.tmatesoft.svn.core.wc.SVNStatus
 @ line 19, column 1.
   import org.tmatesoft.svn.core.wc.SVNStatus
   ^

~/.grails/2.1.0.RC2/projects/twooneoh/plugins/svn-1.0.2/src/groovy/grails/plugin/svn/SvnClient.groovy: 7: unable to resolve class org.tmatesoft.svn.core.SVNProperties
 @ line 7, column 1.
   import org.tmatesoft.svn.core.SVNProperties
   ^

~/.grails/2.1.0.RC2/projects/twooneoh/plugins/svn-1.0.2/src/groovy/grails/plugin/svn/SvnClient.groovy: 10: unable to resolve class org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory
 @ line 10, column 1.
   import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory
   ^

~/.grails/2.1.0.RC2/projects/twooneoh/plugins/svn-1.0.2/src/groovy/grails/plugin/svn/SvnClient.groovy: 16: unable to resolve class org.tmatesoft.svn.core.wc.SVNCopyClient
 @ line 16, column 1.
   import org.tmatesoft.svn.core.wc.SVNCopyClient
   ^

~/.grails/2.1.0.RC2/projects/twooneoh/plugins/svn-1.0.2/src/groovy/grails/plugin/svn/SvnClient.groovy: 17: unable to resolve class org.tmatesoft.svn.core.wc.SVNCopySource
 @ line 17, column 1.
   import org.tmatesoft.svn.core.wc.SVNCopySource
   ^

~/.grails/2.1.0.RC2/projects/twooneoh/plugins/svn-1.0.2/src/groovy/grails/plugin/svn/SvnClient.groovy: 4: unable to resolve class org.tmatesoft.svn.core.SVNDepth
 @ line 4, column 1.
   import org.tmatesoft.svn.core.SVNDepth
   ^
chrisbrookes commented 12 years ago

A quick workaround might be to exclude svn from the plugin in BuildConfig.groovy:

compile (":twitter-bootstrap:2.0.2.25") { excludes 'svn' }

This stops the download and install of the svn plugin for me (I'm using Grails 2.0.0).

superflav commented 12 years ago

That did the trick, thanks!

Anyone know if this project is dead on the vine? Twitter Bootstrap is up to 2.0.4 and the code for this Grails plugin hasn't been updated in months.

https://github.com/twitter/bootstrap/wiki/Changelog

kimifoud commented 12 years ago

Thanks for the fix @chrisbrookes.

chrisbrookes commented 12 years ago

np @kimifoud. @superflav if it's not dead, it's certainly laying very still...

nwittstruck commented 12 years ago

Karol added me as a second admin to this project. If anybody else has the time and wants to support the plugin, feel free to talk to us :)

nwittstruck commented 12 years ago

should be fixed now. can you test it, please?

superflav commented 12 years ago

v2.0.4 of this plugin works great for me, and without the excludes: svn. Thanks!

sammyhk commented 12 years ago

Hi, I also encountered the same issue using Grails 2.1.0 and twitter-bootstrap 2.0.4. This issue happened when I also installed less-resources 1.3.0.2. Is this issue related to twitter-bootstrap? Or I should report this issue to less-resources?

nwittstruck commented 12 years ago

Can you run dependency-report to make sure that it's really the twitter bootstrap plugin that wants to include the svn plugin? I guess less-resources is still including it.

sammyhk commented 12 years ago

Yes, it is required by less-resource 1.3.0.2. I just reported a similar issue on that, thanks for you help.