sbt.ivy.home and ivy.home properties both required
See original GitHub issueSteps
- Create a project for developing a plugin using the scripted plugin.
- Run
sbt scripted
withsbt.ivy.home
pointing to custom location that is not~/.ivy2
Problem
- When the tests run they pull dependencies from a location not specified by sbt.ivy.home, failing tests because they are unable to find the jars published during the publishLocal step
Expectations
- The publishLocal task will place the plugin jar in the location specified by sbt.ivy.home
- The scripted tasks will run and dependencies will be pulled from sbt.ivy.home
Issue Analytics
- State:
- Created 9 years ago
- Reactions:2
- Comments:9 (6 by maintainers)
Top Results From Across the Web
How to configure Ivy cache directory per-user or system-wide?
The sbt.ivy.home property is only half of the solution. It controls where the sbt launcher downloads sbt itself (and related dependencies ...
Read more >sbt Reference Manual — Library Management
Ivy configurations are a useful feature for your build when you need custom groups of dependencies, such as for a plugin. Ivy configurations...
Read more >How to configure Ivy cache directory per-user or system-wide
The sbt.ivy.home property is only half of the solution. It controls where the sbt launcher downloads sbt itself (and related dependencies like the...
Read more >Appendix A. What you need to know about Ivy - sbt in Action
Aether is extracted from the build tool known as Maven, whereas Ivy was built from scratch. Both tools are able to interoperate with...
Read more >Sbt: Dear Dependency Managment - Medium
By default, SBT uses the standard Ivy home directory location ${user.home}/.ivy2/ . What if I would like to create a dir and ask...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As @olafurpg points out, this makes it very difficult to run scripted tests in CI where you need to point to a custom
ivy.home
. Is there any workaround that someone has found?This is what I tried to do for my situation:
Where
CI_PROJECT_DIR
is an env variable set by ci. Then inscripted.sbt
I added the following (because apparentlySBT_OPTS
aren’t respected by thescripted
task):This worked for most of the plugin projects I have been working on, but recently started failing again during a refactor.
After some investigation into that project, I found that the particular issue was due to scoping issues. Inspecting the value of
scriptedLaunchOpts
for the actual plugin project, revealed that it was missing my passthrough forSBT_OPTS
. Adding those settings to my project specific settings made everything resolve properly after that.I hope this helps someone else running into a similar issue with a custom
sbt.ivy.home
and running scripted tests for sbt plugins.any update on this? As @a1kemist has pointed out, this the scripted plugin useless if we can’t run it in CICD where we need to point to a custom
sbt.ivy.home
.I have the following as my scriptedLaunchOptions:
And I’m passing the
sbt.ivy.home
system property to sbt like so:The error output is:
The
sbt.ivy.home
system property is treated as a relative URL to the tmp directory used to scope the sbt plugin test. I’m not sure what the right fix is here. If everything needs to be scoped by the/private/var/...
directory then maybe the scripted plugin should copy the local snapshot to this folder?