I'm trying to package a few in-house artifacts for use with SBT. I would just use the libs
directory in most cases, but there are multiple projects that share the same artifacts.
I've been trying to use the directory structure that is produced by SBT as a basis for this small repository. It stores the artifacts in .ivy2
like so:
.ivy2/cache/[org-with-dots]/[module]/[artifact]-[version].[ext]
I've copied the stuff i need under cache
to it's own folder and then tried the following patterns in SBT to no avail:
resolvers += "cache" at "file:/../ivy-cache"
resolvers += Resolver.file("cache", file("../ivy-cache"))
resolvers += Resolver.file("cache", file("../ivy-cache"))(Resolver.ivyStylePatterns)
resolvers += Resolver.file("cache", file("../ivy-cache"))(Patterns("[organization]/[module]/[artifact]-[revision].[ext]"))
None of these work. The closest was the last one, but organization comes out with slashes instead of dots. The Resolver.ivyStylePatterns
used dots in the organization, but expected a folder called ivys
to be used.
So I have a two part question:
publish
is not desirable./
to .
in the organization component?Found the answer, Pattern
has an apply overload which takes a boolean parameter for its first argument. When true
it uses a Maven style organization string which uses slashes to separate the components, when false
it uses Ivy style (dots).
Here's what worked (with SBT 0.3.9):
resolvers += Resolver.file("cache", file("../ivy-cache"))(Patterns(false,"[organization]/[module]/[artifact]-[revision].[ext]"))
PS: if someone provides a better workflow instead, i will accept that over this answer...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With