question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ivy-style patterns have an extra slash which may cause problems

See original GitHub issue

This 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
eed3si9ncommented, Oct 27, 2017
2reactions
michaelahlerscommented, Oct 27, 2017

LOL. Just giving everyone their due. 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Same Or Different?: Ivy Versus Preppy
Loafers and tassel shoes would be a no-no, except for casual wear. ... Yes, that is absurd, I'm guessing those patterns have change...
Read more >
IIS + PHP Pretty URL (key,value) removes double slashes
The issue: They are using zii 'cgridview' to show their tables; while it's not a pretty solution (might be the implementation), it worked...
Read more >
File System Connector adding forward slash to path
Solved: Hi there, My flow shows double slashes in the root of the gateway filesystem connector ... The problem may be caused by...
Read more >
no-invalid-double-slash-comments - Stylelint
no-invalid-double-slash-comments ... are not supported by CSS and could lead to unexpected results. ... The following patterns are considered problems:.
Read more >
Chapter 10: Regular Expressions - Eloquent JavaScript
This means that slashes inside the expression have to be escaped. ... Patterns specified by regular expressions can do a few things that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found