Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retaining dots in an artifact name

Tags:

scala

sbt

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
like image 822
0__ Avatar asked Mar 03 '14 12:03

0__


2 Answers

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.

like image 168
jsuereth Avatar answered Nov 15 '22 05:11

jsuereth


You can override the behaviour by explicitly defining moduleName, e.g. like this:

moduleName := name.value
like image 32
0__ Avatar answered Nov 15 '22 05:11

0__