scalasbt

java.lang.NumberFormatException: For input string: "230823165626" SBT Dependency


steps

libraryDependencies ++= Seq(
    "Internal Library" % "1.0.230322220316-3078628" (Works Fine) (i.e containing all numbers)
)
libraryDependencies ++= Seq(
    "Internal Library" % "1.0.230823165626-1e552e4" (Error)
)

problem

Error only occurs when I try to:

lazy val `some other project` = StdProject("some other project`", "...")
    .dependsOn(`this project`)

Is importing on independent project which is not a dependency for any other project then no error.

Tried different versions but default.

scalaVersion := "2.13.1"
sbt.version=1.4.9

expectation

We cannot have all numerals version. Need a better fix.

notes

[error] java.lang.NumberFormatException: For input string: "230823165626"
[error]     at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
[error]     at java.lang.Integer.parseInt(Integer.java:583)
[error]     at java.lang.Integer.parseInt(Integer.java:615)
[error]     at scala.collection.immutable.StringLike.toInt(StringLike.scala:304)
[error]     at scala.collection.immutable.StringLike.toInt$(StringLike.scala:304)
[error]     at scala.collection.immutable.StringOps.toInt(StringOps.scala:33)
[error]     at sbt.internal.librarymanagement.cross.CrossVersionUtil$.scalaApiVersion(CrossVersionUtil.scala:65)
[error]     at sbt.internal.librarymanagement.cross.CrossVersionUtil$.$anonfun$binaryScalaVersion$1(CrossVersionUtil.scala:77)
[error]     at sbt.internal.librarymanagement.cross.CrossVersionUtil$.binaryVersionWithApi(CrossVersionUtil.scala:89)
[error]     at sbt.internal.librarymanagement.cross.CrossVersionUtil$.binaryScalaVersion(CrossVersionUtil.scala:77)
[error]     at sbt.librarymanagement.CrossVersionFunctions.binaryScalaVersion(CrossVersionExtra.scala:177)
[error]     at sbt.internal.librarymanagement.IvyScalaUtil$.binaryScalaWarning$1(IvyScalaUtil.scala:139)
[error]     at sbt.internal.librarymanagement.IvyScalaUtil$.$anonfun$checkDependencies$2(IvyScalaUtil.scala:154)
[error]     at scala.collection.immutable.List.flatMap(List.scala:366)
[error]     at sbt.internal.librarymanagement.IvyScalaUtil$.checkDependencies(IvyScalaUtil.scala:154)
[error]     at sbt.internal.librarymanagement.IvyScalaUtil$.checkModule(IvyScalaUtil.scala:32)
[error]     at sbt.internal.librarymanagement.IvySbt$Module.$anonfun$x$7$1(Ivy.scala:273)
[error]     at sbt.internal.librarymanagement.IvySbt$Module.$anonfun$x$7$1$adapted(Ivy.scala:271)
[error]     at scala.Option.foreach(Option.scala:407)
[error]     at sbt.internal.librarymanagement.IvySbt$Module.x$7$lzycompute(Ivy.scala:271)
[error]     at sbt.internal.librarymanagement.IvySbt$Module.x$7(Ivy.scala:262)
[error]     at sbt.internal.librarymanagement.IvySbt$Module.moduleDescriptor0$lzycompute(Ivy.scala:262)
[error]     at sbt.internal.librarymanagement.IvySbt$Module.moduleDescriptor0(Ivy.scala:262)
[error]     at sbt.internal.librarymanagement.IvySbt$Module.$anonfun$withModule$1(Ivy.scala:251)
[error]     at sbt.internal.librarymanagement.IvySbt.$anonfun$withIvy$1(Ivy.scala:215)
[error]     at sbt.internal.librarymanagement.IvySbt.sbt$internal$librarymanagement$IvySbt$$action$1(Ivy.scala:77)
[error]     at sbt.internal.librarymanagement.IvySbt$$anon$1.call(Ivy.scala:87)
[error]     at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:113)
[error]     at xsbt.boot.Locks$GlobalLock.withChannelRetries$1(Locks.scala:91)
[error]     at xsbt.boot.Locks$GlobalLock.$anonfun$withFileLock$1(Locks.scala:119)
[error]     at xsbt.boot.Using$.withResource(Using.scala:12)
[error]     at xsbt.boot.Using$.apply(Using.scala:9)
[error]     at xsbt.boot.Locks$GlobalLock.withFileLock(Locks.scala:119)
[error]     at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:71)
[error]     at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:59)
[error]     at xsbt.boot.Locks$.apply0(Locks.scala:47)
[error]     at xsbt.boot.Locks$.apply(Locks.scala:36)
[error]     at sbt.internal.librarymanagement.IvySbt.withDefaultLogger(Ivy.scala:87)
[error]     at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:209)
[error]     at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:206)
[error]     at sbt.internal.librarymanagement.IvySbt$Module.withModule(Ivy.scala:250)
[error]     at sbt.internal.librarymanagement.IvySbt$Module.moduleDescriptor(Ivy.scala:254)
[error]     at sbt.internal.librarymanagement.IvySbt$Module.dependencyMapping(Ivy.scala:256)
[error]     at sbt.Classpaths$.$anonfun$depMap$5(Defaults.scala:3705)
[error]     at scala.collection.immutable.List.map(List.scala:297)
[error]     at sbt.Classpaths$.$anonfun$depMap$4(Defaults.scala:3705)
[error]     at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]     at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]     at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error]     at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error]     at sbt.Execute.work(Execute.scala:291)
[error]     at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error]     at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error]     at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[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:750)

Cannot understand the problem, tried changing version and debugging.


Solution

  • 230823165626 is larger than Int.MaxValue (2147483647). Since you can't change sbt to use a Long there, you instead need to change the number to be within the range of Int