foundweekends / giter8

a command line tool to apply templates defined on GitHub
https://www.foundweekends.org/giter8/
Apache License 2.0
1.74k stars 224 forks source link

g8Test does not respect custom resolvers #650

Open Jacoby6000 opened 2 years ago

Jacoby6000 commented 2 years ago

steps

sbt version: 1.5.5 g8 version: 0.14.0 Create a template with a dependency on a project not in a default maven/ivy resolver. Create a .repositories file in the template, containing your custom resolver

problem

Executing sbt g8Test fails, if there is a dependency on a non-default repository within the project. It does not read the .repositories file and unresolved dependencies throw errors.

[info] [error] (update) sbt.librarymanagement.ResolveException: Error downloading com.acmeproduct.super:super-project;sbtVersion=1.0;scalaVersion=2.12:2.2.2
[info] [error]   Not found
[info] [error]   Not found
[info] [error]   not found: https://repo1.maven.org/maven2/com/acmeproduct/super/super-project_2.12_1.0/2.2.2/super-project-2.2.2.pom
[info] [error]   not found: /home/jbarber/.ivy2/local/com.acmeproduct.super/super-project/scala_2.12/sbt_1.0/2.2.2/ivys/ivy.xml
[info] [error]   not found: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.acmeproduct.super/super-project/scala_2.12/sbt_1.0/2.2.2/ivys/ivy.xml
[info] [error]   not found: https://repo.typesafe.com/typesafe/ivy-releases/com.acmeproduct.super/super-project/scala_2.12/sbt_1.0/2.2.2/ivys/ivy.xml
[info] [error] Error downloading com.acmeproduct.module:sbt-plugin-workflow;sbtVersion=1.0;scalaVersion=2.12:1.1.2
[info] [error]   Not found
[info] [error]   Not found
[info] [error]   not found: https://repo1.maven.org/maven2/com/acmeproduct/module/sbt-plugin-workflow_2.12_1.0/1.1.2/sbt-plugin-workflow-1.1.2.pom
[info] [error]   not found: /home/jbarber/.ivy2/local/com.acmeproduct.module/sbt-plugin-workflow/scala_2.12/sbt_1.0/1.1.2/ivys/ivy.xml
[info] [error]   not found: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.acmeproduct.module/sbt-plugin-workflow/scala_2.12/sbt_1.0/1.1.2/ivys/ivy.xml
[info] [error]   not found: https://repo.typesafe.com/typesafe/ivy-releases/com.acmeproduct.module/sbt-plugin-workflow/scala_2.12/sbt_1.0/1.1.2/ivys/ivy.xml
[info] [error] Error downloading com.acmeproduct.module:sbt-magic-plugin;sbtVersion=1.0;scalaVersion=2.12:1.2.1
[info] [error]   Not found
[info] [error]   Not found
[info] [error]   not found: https://repo1.maven.org/maven2/com/acmeproduct/module/sbt-magic-plugin_2.12_1.0/1.2.1/sbt-magic-plugin-1.2.1.pom
[info] [error]   not found: /home/jbarber/.ivy2/local/com.acmeproduct.module/sbt-magic-plugin/scala_2.12/sbt_1.0/1.2.1/ivys/ivy.xml
[info] [error]   not found: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.acmeproduct.module/sbt-magic-plugin/scala_2.12/sbt_1.0/1.2.1/ivys/ivy.xml
[info] [error]   not found: https://repo.typesafe.com/typesafe/ivy-releases/com.acmeproduct.module/sbt-magic-plugin/scala_2.12/sbt_1.0/1.2.1/ivys/ivy.xml
[info] [error] Error downloading com.acmeproduct.module:sbt-plugin-module;sbtVersion=1.0;scalaVersion=2.12:1.1.2
[info] [error]   Not found
[info] [error]   Not found
[info] [error]   not found: https://repo1.maven.org/maven2/com/acmeproduct/module/sbt-plugin-module_2.12_1.0/1.1.2/sbt-plugin-module-1.1.2.pom
[info] [error]   not found: /home/jbarber/.ivy2/local/com.acmeproduct.module/sbt-plugin-module/scala_2.12/sbt_1.0/1.1.2/ivys/ivy.xml
[info] [error]   not found: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.acmeproduct.module/sbt-plugin-module/scala_2.12/sbt_1.0/1.1.2/ivys/ivy.xml
[info] [error]   not found: https://repo.typesafe.com/typesafe/ivy-releases/com.acmeproduct.module/sbt-plugin-module/scala_2.12/sbt_1.0/1.1.2/ivys/ivy.xml

expectation

The .repositories file should be read and the proper resolvers should be loaded.

notes

I don't think this is a problem with sbt-scripted. I have written sbt-plugins that use our custom resolvers and those seem to work

TonioGela commented 2 years ago

Thanks for reporting. May I ask you if this happens with custom resolvers defined directly in the sbt build?