giter8
giter8 copied to clipboard
`sbt new` not working reliable, gives server errors
- Originally posted here: https://github.com/sbt/sbt/issues/8144
steps
-
sbt new - choosing
g(play-java-seed.g8) - takes a while
problem
Timeout with error message
Unexpected response status 504 fetching metadata from https://search.maven.org/solrsearch/select?q=g:%22org.foundweekends.giter8%22+AND+a:%22giter8_2.13%22&rows=10&wt=xml
expectation
sbt new should work - and take you to the next step (name [play-java-seed]: ...)
notes
This did happen to me 3 times in the last 2 weeks, other user(s) are reporting the same in https://github.com/sbt/sbt/issues/8144
It looks like the problem originates here:
- https://github.com/playframework/play-java-seed.g8/blob/3.0.x/src/main/g8/default.properties#L11
- https://github.com/foundweekends/giter8/blob/v0.17.0/library/src/main/scala/giter8/MavenHelper.scala#L24-L26
Maybe giter8 should fall back to a default if it can't fetch the versions from the maven.org api?
- Either hardcode some values for the most used libraries.
- Or what about a fallback mechanism in the properties file itself? Something like
So if the server error occurs OR if after like a timeout of 3 seconds no answer received yet the fallback will be used instead?sbt_giter8_scaffold_version = maven(org.foundweekends.giter8, giter8_2.13), 0.17.0
For the play seed projects, as a workaround I made them avoid querying maven.org:
- https://github.com/playframework/play-java-seed.g8/pull/205
- https://github.com/playframework/play-java-seed.g8/pull/204
- https://github.com/playframework/play-scala-seed.g8/pull/280
- https://github.com/playframework/play-scala-seed.g8/pull/281
- https://github.com/foundweekends/giter8/pull/977
0.18.0-RC1 released