scala - sbt,publishLocal 和 publish,未定义的解析器
问题描述
我想将我的工件推送到本地常春藤存储库和远程存储库,以便将它们用作其他项目中的依赖项。但他们都没有成功。
我的 SparkBuild.scala:
resolvers := Seq(
// Google Mirror of Maven Central, placed first so that it's used instead of flaky Maven Central.
// See https://storage-download.googleapis.com/maven-central/index.html for more info.
"gcs-maven-central-mirror" at "https://maven-central.storage-download.googleapis.com/maven2/",
DefaultMavenRepository,
Resolver.mavenLocal,
Resolver.file("ivyLocal", file(Path.userHome.absolutePath + "/.ivy2/local"))(Resolver.ivyStylePatterns)
),
externalResolvers := resolvers.value,
otherResolvers := SbtPomKeys.mvnLocalRepository(dotM2 => Seq(Resolver.file("dotM2", dotM2))).value,
publishLocalConfiguration in MavenCompile := PublishConfiguration()
.withResolverName("dotM2")
.withArtifacts(packagedArtifacts.value.toVector)
.withLogging(ivyLoggingLevel.value),
publishLocalConfiguration in SbtCompile := PublishConfiguration()
.withResolverName("ivyLocal")
.withArtifacts(packagedArtifacts.value.toVector)
.withLogging(ivyLoggingLevel.value),
publishMavenStyle in MavenCompile := true,
publishMavenStyle in SbtCompile := false,
publishLocal in MavenCompile := publishTask(publishLocalConfiguration in MavenCompile).value,
publishLocal in SbtCompile := publishTask(publishLocalConfiguration in SbtCompile).value,
publishLocal := Seq(publishLocal in MavenCompile, publishLocal in SbtCompile).dependOn.value,
publishTo := {
val nexus = "http://maven.baidu-int.com/nexus/content/repositories/"
if (isSnapshot.value)
Some("snapshots" at nexus + "Baidu_Local_Snapshots")
else
Some("releases" at nexus + "Baidu_Local")
},
运行 publishLocal 任务:
[error] (sql / publish) Undefined resolver 'snapshots'
[error] (tags / publish) Undefined resolver 'snapshots'
[error] (sql-kafka-0-10 / publish) Undefined resolver 'snapshots'
[error] java.lang.RuntimeException: Undefined resolver 'snapshots'
[error] at scala.sys.package$.error(package.scala:30)
[error] at sbt.internal.librarymanagement.IvyActions$.$anonfun$publish$1(IvyActions.scala:136)
[error] at sbt.internal.librarymanagement.IvyActions$.$anonfun$publish$1$adapted(IvyActions.scala:133)
我可以成功运行编译、UT、打包,但无法发布。
它出什么问题了?
解决方案
推荐阅读
- android - 更新最小值/最大值时重绘 Xamarin (Android) 滑块
- dart - Flutter App iOS Simulator 设置透明代理
- android - 列表未在删除项目上发出 (RxKotlin)
- reactjs - 如何使用 react-native 打开列表中的键盘
- java - 使用 Java、Spring 发出 Oauth2 请求
- python - Scrapy - 在第一次请求后收到 504 网关超时
- java - 是否可以缩写删除变量的java函数?
- c# - 是否推荐/可以接受将 async void 方法运行到新线程中?
- git - 为什么当我在“X”分支中进行更改时,我的主分支也会以同样的方式发生变化?
- vba - 如何使用 Windows 任务计划程序每周一运行 Excel 宏