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

Cannot load resource #104

Closed
yanns opened this issue Jan 27, 2017 · 7 comments
Closed

Cannot load resource #104

yanns opened this issue Jan 27, 2017 · 7 comments
Milestone

Comments

@yanns
Copy link
Contributor

yanns commented Jan 27, 2017

First of all, thanks for this sbt plugin!

I have a little problem:
If I try to load a resource like:

getClass.getClassLoader.getResourceAsStream("my-file.json")

with my-file.json inside resources,

-> this works with a Main extends App
-> but does not work for a JMH benchmark.

I guess that the resources are not available for the jmh:run sbt scope.

@rockwotj
Copy link

Did you figure out a workaround? I tried adding resourceDirectories in Jmh += (resourceDirectory in Compile).value, but that didn't seem to help

@rockwotj
Copy link

rockwotj commented Feb 22, 2017

It seems: resourceDirectory in Jmh := (resourceDirectory in Compile).value fixed this however. Not sure why the former didn't work!

@agourlay
Copy link

@rockwotj thank you for the workaround 👍

@yanns
Copy link
Contributor Author

yanns commented Feb 23, 2017

thx @rockwotj!
This is a configuration we could put into the plugin

@ktoso
Copy link
Member

ktoso commented Feb 23, 2017 via email

yanns added a commit to yanns/sbt-jmh that referenced this issue Feb 24, 2017
@yanns
Copy link
Contributor Author

yanns commented Feb 24, 2017

#109

@ktoso ktoso closed this as completed in d5c2995 Mar 13, 2017
@ktoso ktoso added this to the 0.2.23 milestone Mar 13, 2017
@ktoso
Copy link
Member

ktoso commented Mar 13, 2017

Releasing fix right now, update to 0.2.23

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

4 participants