spring-attic / rest-shell

Command-line shell for interacting with Spring HATEOAS-compliant REST resources
Apache License 2.0
455 stars 100 forks source link

Build failed #27

Open tzvatot opened 11 years ago

tzvatot commented 11 years ago

I created a fresh clone and run ./gradlew installApp which failed. Run again with --debug and it seems like a bad dependency:

16:22:57.995 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.api.internal.artifacts.ivyservice.ModuleVersionNotFoundException: Could not find group:org.springframework.shell, module:spring-shell, version:1.0.1.BUILD-SNAPSHOT.

jbrisbin commented 11 years ago

I need to update the README, but you have to install my fork of spring-shell into your local maven repos before building rest-shell. The changes in my fork haven't made it upstream yet and for the dotrc file reading to happen, you have to use the changes I made to spring-shell.

https://github.com/jbrisbin/spring-shell

git clone git://github.com/jbrisbin/spring-shell.git cd spring-shell ./gradlew install

Then try building rest-shell again.

tzvatot commented 11 years ago

Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts. Permission denied (publickey). fatal: The remote end hung up unexpectedly

jbrisbin commented 11 years ago

trying using the non-ssh url git://github.com/jbrisbin/spring-shell.git (updated the above with this as well)

tzvatot commented 11 years ago

Thanks, that did the trick. Can you expand a little bit about the difference between your version of spring-shell and 'master's? Also, I could not find any documentation on where to set 'basic type conversion'. I run get on a json resource and it fails with this TODO message.

jbrisbin commented 11 years ago

You can see my commits here: https://github.com/jbrisbin/spring-shell/commits/master

Basically, I changed the way commands are registered because what I found was that when the start() lifecycle hook was called in the code in master, my custom commands weren't yet available because they were being added later. I just made the shell component aware of ContextRefreshedEvents so it could find commands as soon as they were available rather than waiting until after the context is completely initialized (and all start methods, etc... are called) before registering custom commands.

RE: the error: could you give more information on the resource you're accessing and the kind of error you're seeing?

There are a couple ways to configure conversion in the rest-shell, especially if you're building from source (the default configuration is just a blanket component-scan). In particular, if you look in the org.springframework.data.rest.shell.commands.HttpCommands class you'll see that the RestTemplate and ObjectMapper are injected if one exists. You can change the META-INF/spring/spring-shell-plugin.xml file to add a fully-configured RestTemplate that uses whatever converters you want to suite your use-case and that should be picked up and used in preference to the default configuration.