Ivy-style patterns have an extra slash which may cause problems
See original GitHub issueThis was discoverd by @michaelahlers in https://github.com/ohnosequences/sbt-s3-resolver/issues/52. Here I’ll try to show the problem without using sbt-s3-resolver.
steps
Minimal project setup:
-
project/plugins.sbt
:addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.1")
-
build.sbt
:name := "foo" organization := "org" licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0")) version := "0.1.0" publishMavenStyle := false bintrayReleaseOnPublish := false bintrayOrganization := None bintrayRepository := "ivy" bintrayVcsUrl := Some("git@github.com:laughedelic/foo.git")
The bintray plugin here is not so important. It should be the same with the standard Resolver.url
. I use bintray here just for demonstration. Important part here is the usage of ivyStylePatterns
.
problem
Here is an excerpt from the output of the publish
task:
[info] published foo_2.12 to org/foo_2.12//0.1.0/jars/foo_2.12.jar
[info] published foo_2.12 to org/foo_2.12//0.1.0/srcs/foo_2.12-sources.jar
[info] published foo_2.12 to org/foo_2.12//0.1.0/docs/foo_2.12-javadoc.jar
[info] published ivy to org/foo_2.12//0.1.0/ivys/ivy.xml
Notice the //
before the version in the destination paths. Here it doesn’t cause any problems with publishing, because the URL are sanitized at some point in the resolver. But it may cause problems for resolvers that treat such paths literally, such as S3: see https://github.com/ohnosequences/sbt-s3-resolver/issues/52#issuecomment-331543141.
The same thing happens in resolution (see the original post in the linked issue).
expectation
The ivy-pattern should be corrected (see https://github.com/sbt/librarymanagement/pull/170). I don’t know if any additional patterns/URL sanitizing is possible in sbt, or it’s completely dependent on how resolvers work with URLs…
notes
- sbt version: 1.0.2
This problem affects all versions of sbt 1.+. I think it was introduced in https://github.com/sbt/librarymanagement/commit/5ea0e0e07ae9c8a194b2ff2690dc093f8ef237ec, but wasn’t integrated in sbt until v1.0.0.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Please thank @laughedelic who fixed this in https://github.com/sbt/librarymanagement/pull/170 😃
LOL. Just giving everyone their due. 😉