I have a library which uses dots in the artifact name, like "org.scala-refactoring.library"
. With a project name definition such as:
name := "org.scala-refactoring.library"
This gets converted to hyphens when using publish-local
, so it becomes "org-scala-refactoring-library
".
How do I retain the dots in the published artifact?
This seems to be something happening in publishing not packaging. For example, the following has no effect:
artifactName := { (sv, module, artifact) =>
s"${name.value}_${sv.binary}-${module.revision}.${artifact.extension}"
}
It does package as
target/scala-2.11.0-RC1/org.scala-refactoring.library_2.11.0-RC1-0.6.2-SNAPSHOT.jar
But it still publishes to
~/.ivy2/local/org.scala-refactoring/org-scala-refactoring-library_2.11.0-RC1/0.6.2-SNAPSHOT
This appears to be Ivy behavior. You can specify a custom ivy pattern for publishing.
If you read about ivy patterns: http://ant.apache.org/ivy/history/latest-milestone/concept.html You can see there's an [originalname]
option which may do what you wish here. My guess is [artifact]
(what sbt uses now) may be escaping things.
You can override the behaviour by explicitly defining moduleName
, e.g. like this:
moduleName := name.value
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With