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

Scalafix fails to resolve custom ivy repo #1077

Closed
kamilkloch opened this issue Mar 17, 2020 · 6 comments
Closed

Scalafix fails to resolve custom ivy repo #1077

kamilkloch opened this issue Mar 17, 2020 · 6 comments

Comments

@kamilkloch
Copy link

Scalafix version 0.9.11, sbt 1.2.8, 1.3.x.

Custom scalafix resolver and dependency are added as follows:

scalafixResolvers in ThisBuild ++= Seq(new Repository.Ivy("http://my-artifacory-repo/"))

scalafixDependencies in ThisBuild += "myorg" %% "my-scalafix-rules" % "1.2.23-RC1"

Resolver is visible within sbt:

sbt:x-api> scalafixResolvers
[info] * Ivy2Local
[info] * Maven("https://repo1.maven.org/maven2")
[info] * Maven("https://oss.sonatype.org/content/repositories/releases")
[info] * Maven("https://oss.sonatype.org/content/repositories/snapshots")
[info] * Ivy("http://my-artifactory-repo/")

So is scalafix dependency:

sbt:x-api> scalafixDependencies
[info] * myorg:my-scalafix-rules:1.2.23-RC1

Downloading scalafix dependency fails with RTE:

sbt:x-api> scalafix X013
[error] coursierapi.error.SimpleResolutionError$1: Error downloading superfund:scalafix-rules_2.12:1.2.23-RC1
[error]   not found: /home/kamilk/.ivy2/local/superfund/scalafix-rules_2.12/1.2.23-RC1/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/superfund/scalafix-rules_2.12/1.2.23-RC1/scalafix-rules_2.12-1.2.23-RC1.pom
[error]   not found: https://oss.sonatype.org/content/repositories/releases/superfund/scalafix-rules_2.12/1.2.23-RC1/scalafix-rules_2.12-1.2.23-RC1.pom
[error]   not found: https://oss.sonatype.org/content/repositories/snapshots/superfund/scalafix-rules_2.12/1.2.23-RC1/scalafix-rules_2.12-1.2.23-RC1.pom
[error]   org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 55; White spaces are required between publicId and systemId. (White spaces are required between publicId and systemId.)
[error] 	at coursierapi.error.SimpleResolutionError.of(SimpleResolutionError.java:11)
[error] 	at coursierapi.shaded.coursier.internal.api.ApiHelper$.simpleResError(ApiHelper.scala:271)
[error] 	at coursierapi.shaded.coursier.internal.api.ApiHelper$.doFetch(ApiHelper.scala:297)
[error] 	at coursierapi.shaded.coursier.internal.api.ApiHelper.doFetch(ApiHelper.scala)
[error] 	at coursierapi.Fetch.fetchResult(Fetch.java:219)
[error] 	at coursierapi.Fetch.fetch(Fetch.java:214)
[error] 	at scalafix.internal.sbt.ScalafixCoursier$.runFetch(ScalafixCoursier.scala:88)
[error] 	at scalafix.internal.sbt.ScalafixCoursier$$anon$1.apply(ScalafixCoursier.scala:74)
[error] 	at scalafix.internal.sbt.ScalafixCoursier$$anon$1.apply(ScalafixCoursier.scala:58)
[error] 	at java.util.HashMap.computeIfAbsent(HashMap.java:1127)
[error] 	at java.util.Collections$SynchronizedMap.computeIfAbsent(Collections.java:2674)
[error] 	at scalafix.internal.sbt.ScalafixCoursier$.scalafixToolClasspath(ScalafixCoursier.scala:44)
[error] 	at scalafix.internal.sbt.ScalafixInterface$.$anonfun$fromToolClasspath$1(ScalafixInterface.scala:31)
[error] 	at scala.util.Try$.apply(Try.scala:209)
[error] 	at scalafix.internal.sbt.ScalafixInterface$LazyValue._value$lzycompute(ScalafixInterface.scala:13)
[error] 	at scalafix.internal.sbt.ScalafixInterface$LazyValue._value(ScalafixInterface.scala:13)
[error] 	at scalafix.internal.sbt.ScalafixInterface$LazyValue.apply(ScalafixInterface.scala:14)
[error] 	at scalafix.sbt.ScalafixPlugin$.scalafixArgsFromShell(ScalafixPlugin.scala:112)
[error] 	at scalafix.sbt.ScalafixPlugin$.$anonfun$scalafixInputTask$4(ScalafixPlugin.scala:150)
[error] 	at sbt.std.FullInstance$.$anonfun$flattenFun$3(TaskMacro.scala:79)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error] 	at sbt.std.Transform$$anon$4.work(System.scala:67)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] 	at sbt.Execute.work(Execute.scala:278)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] 	at java.lang.Thread.run(Thread.java:748)
@bjaglin
Copy link
Collaborator

bjaglin commented May 20, 2020

can you reproduce this with coursier in CLI ? if so, you might file a ticket upstream

@scottrice10
Copy link
Contributor

I believe this is answer by #1228.

@bjaglin
Copy link
Collaborator

bjaglin commented Aug 20, 2020

@kamilkloch please re-open if it still does not work with the syntax freshly documented in https://github.com/scalacenter/scalafix/pull/1228/files

@bjaglin bjaglin closed this as completed Aug 20, 2020
@kamilkloch
Copy link
Author

@bjaglin It works indeed, thanku you! :)

@bjaglin
Copy link
Collaborator

bjaglin commented Aug 20, 2020

good - but it's @scottrice10 you should thank!

@kamilkloch
Copy link
Author

@scottrice10 Thank you!

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

3 participants