You can create a custom dependency configuration for this (actually, this is getting so common when you use private macros in your project, I wish SBT provided one).
In build.sbt
:
// a 'compileonly' configuation
ivyConfigurations += config("compileonly").hide
// some compileonly dependency
libraryDependencies += "commons-io" % "commons-io" % "2.4" % "compileonly"
// appending everything from 'compileonly' to unmanagedClasspath
unmanagedClasspath in Compile ++=
update.value.select(configurationFilter("compileonly"))
That dependency will not appear in the pom.xml
generated by publish
and friends.
There almost is such a configuration available: the provided
configuration. Except that provided
ends up in the pom.xml
as a dependency with provided
scope. Also, provided
means "the runtime itself provides this at runtime", not "this is not needed at runtime".
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…