Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

playRunHooks ClassNotFoundException re: sbt-yeoman GruntProcess #74

Open
qberticus opened this issue Mar 29, 2015 · 5 comments
Open

playRunHooks ClassNotFoundException re: sbt-yeoman GruntProcess #74

qberticus opened this issue Mar 29, 2015 · 5 comments

Comments

@qberticus
Copy link

Play version: 2.3.8
Scala version: 2.11.1
sbt-yeoman: 0.7.1
using a build.sbt file

When using play-yeoman the addition of the GruntProcess to the playRunHooks setting causes a ClassNotFoundException during execution of the playRun task or show playRunHooks.

In order to add an additional PlayRunHook instances to playRunHooks it current requires setting playRunHooks := Seq() in the build.sbt file to remove the play-yeoman hook.

show playRunHooks output:

[trace] Stack trace suppressed: run last *:playRunHooks for the full output.
[error] (*:playRunHooks) java.lang.NoClassDefFoundError: play/PlayRunHook$class
[error] Total time: 0 s, completed Mar 28, 2015 4:48:14 PM

last *:playRunHooks output:

Caused by: java.lang.ClassNotFoundException: play.PlayRunHook$class
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at com.tuplejump.sbt.yeoman.Yeoman$Grunt$GruntProcess$2$.<init>(Yeoman.scala:160)
        at com.tuplejump.sbt.yeoman.Yeoman$Grunt$.GruntProcess$1$lzycompute(Yeoman.scala:160)
        at com.tuplejump.sbt.yeoman.Yeoman$Grunt$.GruntProcess$1(Yeoman.scala:160)
        at com.tuplejump.sbt.yeoman.Yeoman$Grunt$.apply(Yeoman.scala:174)
...
[error] (*:playRunHooks) java.lang.NoClassDefFoundError: play/PlayRunHook$class
@tproenca
Copy link

Same happening with me. Any workaround to get it working?

@qberticus
Copy link
Author

Yea, I created my own grunt play run hook based on the one in play-yeoman as a temp solution. With this one you need to specify the grunt task to run. I did this since I use browserify with watchify and needed a custom task that runs browserify before watch.

https://gist.github.com/qberticus/232e821bc7ec6417fe69

@tproenca
Copy link

tproenca commented Apr 3, 2015

Thanks for the reply. When I add the content from the gist to the build.sbt, I got the following error:

playRunHooks := Seq()
^
[error] Type error in expression

Do you have any idea what went wrong?

@tproenca
Copy link

tproenca commented Apr 4, 2015

Found the import that was missing:

  import play.PlayImport.PlayKeys.playRunHooks

Thanks for your help on this :)

@adridadou
Copy link

Thank you for your fix! I will try that as I had the same issue.
Would it be possible for you @qberticus to make a pull request with your playHook?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants