I want to push my artifacts to local ivy repository and remote repository in order to use them as dependencies in other projects. But none of them success.
My 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")
},
Run publishLocal task:
[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)
I can run compile, UT, package successfully, but just cannot publish.
What's wrong with it?