简体   繁体   English

磨机:失败解决AmmoniteReplIvyDeps

[英]mill: Failed resolvedAmmoniteReplIvyDeps

I have following very simple module definition in build.src我在build.src有以下非常简单的模块定义

import mill._
import mill.bsp.BSP.millSourcePath
import mill.scalalib.{JavaModule, ScalaModule}

object scalaMod0 extends ScalaModule {
  override def scalaVersion = "2.13.6"
}

Mill version is 0.9.9 Mill 版本是 0.9.9

Then I try to run然后我试着跑

mill show scalaMod0.resolvedAmmoniteReplIvyDeps

1/1] show interp.watchValue millSourcePath: /home/jk/workspace.exp/hands-on-scala/mill01

[1/1] show > [9/9] scalaMod0.resolvedAmmoniteReplIvyDeps | Downloading [2/2] artifacts (~0/0 bytes)
1 targets failed
show 1 targets failed
scalaMod0.resolvedAmmoniteReplIvyDeps 
Resolution failed for 1 modules:
--------------------------------------------
  com.lihaoyi:ammonite_2.13.6:2.3.8-65-0f0d597f 
    not found: /home/jk/.ivy2/local/com.lihaoyi/ammonite_2.13.6/2.3.8-65-0f0d597f/ivys/ivy.xml
    not found: https://repo1.maven.org/maven2/com/lihaoyi/ammonite_2.13.6/2.3.8-65-0f0d597f/ammonite_2.13.6-2.3.8-65-0f0d597f.pom

The contents of https://repo1.maven.org/maven2/com/lihaoyi/ammonite_2.13.6 are following: https://repo1.maven.org/maven2/com/lihaoyi/ammonite_2.13.6的内容如下:

com/lihaoyi/ammonite_2.13.6

../
2.3.8-122-9be39deb/                               2021-05-17 21:19         -      
2.3.8-123-0b9a8c9b/                               2021-05-18 14:20         -      
2.3.8-124-2da846d2/                               2021-05-19 04:57         -      
2.3.8-125-f6bb1cf9/                               2021-06-08 13:15         -      
2.3.8-67-4b6c67db/                                2021-05-17 19:50         -      
2.4.0/                                            2021-06-08 13:25         -      
2.4.0-10-40f87721/                                2021-07-27 12:49         -      
2.4.0-11-5b9ff5e7/                                2021-07-27 12:57         -      
2.4.0-12-69f45b4b/                                2021-07-27 13:05         -      
2.4.0-13-6ffcb9ff/                                2021-07-30 16:49         -      
2.4.0-14-4824b429/                                2021-08-02 15:59         -      
2.4.0-17-6dbd7856/                                2021-08-30 14:06         -      
2.4.0-18-12c9e33e/                                2021-09-01 15:35         -      
2.4.0-19-f4790b61/                                2021-09-01 16:24         -      
2.4.0-20-f3d8171f/                                2021-09-09 16:33         -      
2.4.0-22-a70409dc/                                2021-09-09 23:09         -      
2.4.0-23-76673f7f/                                2021-09-16 16:30         -      
2.4.0-5-534c9436/                                 2021-07-15 18:25         -      
2.4.0-6-426d8ae5/                                 2021-07-27 10:13         -      
2.4.0-9-0017ff97/                                 2021-07-27 11:59         -      
maven-metadata.xml                                2021-09-16 16:32      1175      
maven-metadata.xml.md5                            2021-09-16 16:32        32      
maven-metadata.xml.sha1                           2021-09-16 16:32        40      
maven-metadata.xml.sha256                         2021-09-16 16:32        64      
maven-metadata.xml.sha512                         2021-09-16 16:32       128      
        

So the requested dir 2.3.8-65-0f0d597f does not exist.所以请求的目录2.3.8-65-0f0d597f不存在。

How can I fix this?我怎样才能解决这个问题?

Where is this 2.3.8-65-0f0d597f configured or selected?这个2.3.8-65-0f0d597f在哪里配置或选择? Why does mill want exactly this non-existing ammonite version?为什么磨坊需要这种不存在的菊石版本?

When I start my local installed ammonite, it shows following version information:当我启动本地安装的 ammonite 时,它​​显示以下版本信息:

amm
Loading...
Welcome to the Ammonite Repl 2.2.0 (Scala 2.13.3 Java 11.0.11)

Thank you for your help!感谢您的帮助!

This is already discussed in the mill discussions forum ( https://github.com/com-lihaoyi/mill/discussions/1396 ).这已经在工厂讨论论坛 ( https://github.com/com-lihaoyi/mill/discussions/1396 ) 中讨论过。

I'm mostly quoting an adapted version here:我主要在这里引用一个改编版本:

Mill will by default pick the same ammonite version which it uses internally.默认情况下,Mill 会选择它内部使用的相同的菊石版本。 But as ammonite releases need to match the full Scala version, and the pre-selected ammonite version ( 2.3.8-65-0f0d597f ) wasn't released for Scala 2.13.6 , you need to specify another ammonite version by overriding def ammoniteVersion .但是由于菊石版本需要匹配完整的 Scala 版本,并且预选的2.3.8-65-0f0d597f版本 ( 2.3.8-65-0f0d597f ) 没有为 Scala 2.13.6发布,您需要通过覆盖def ammoniteVersion 2.3.8-65-0f0d597f来指定另一个菊石版本。

For example:例如:

import mill._
import mill.scalalib.ScalaModule

object scalaMod0 extends ScalaModule {
  override def scalaVersion = "2.13.6"
  override def ammoniteVersion = "2.4.0"
  // ...
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM