Home > database >  mill: Failed resolvedAmmoniteReplIvyDeps
mill: Failed resolvedAmmoniteReplIvyDeps

Time:10-08

I have following very simple module definition in 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

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:

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.

How can I fix this?

Where is this 2.3.8-65-0f0d597f configured or selected? Why does mill want exactly this non-existing ammonite version?

When I start my local installed ammonite, it shows following version information:

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

Thank you for your help!

CodePudding user response:

This is already discussed in the mill discussions forum (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 was used to built it. 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.

For example:

import mill._
import mill.scalalib.ScalaModule

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