我習慣于使用~=或>=允許包管理器升級到最新的兼容版本。
sbt 或 Scala 是否有類似的東西?我在他們的檔案中找不到它:https : //www.scala-sbt.org/1.x/docs/Library-Management.html
Bundler 等價物:https:
//bundler.io/gemfile.html pip 等價物:https : //pip.pypa.io/en/stable/reference/requirements-file-format/#example
謝謝你的時間??
uj5u.com熱心網友回復:
我只想總結評論中的對話:
有一種方法可以做到:https : //ant.apache.org/ivy/history/2.3.0/ivyfile/dependency.html#revision
語法是:
Examples:
[1.0,2.0] matches all versions greater or equal to 1.0 and lower or equal to 2.0
[1.0,2.0[ matches all versions greater or equal to 1.0 and lower than 2.0
]1.0,2.0] matches all versions greater than 1.0 and lower or equal to 2.0
]1.0,2.0[ matches all versions greater than 1.0 and lower than 2.0
[1.0,) matches all versions greater or equal to 1.0
]1.0,) matches all versions greater than 1.0
(,2.0] matches all versions lower or equal to 2.0
(,2.0[ matches all versions lower than 2.0
不推薦這樣做,還有其他工具可以幫助解決依賴關系。
即使我對 Scala/Java 世界進行了極其簡短的探索,許多依賴項往往會被破壞,并且向后兼容性似乎比我使用 Python 和 Ruby 的經驗更重要。甚至檔案似乎也會導致依賴關系中斷。為什么這些版本范圍通常不用于 Scala/Java 世界是有道理的。這也很可能是因為我對 Scala/Java 缺乏經驗。
希望有幫助??
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/362480.html
