diff --git a/core/src/main/scala/com/lightbend/paradox/markdown/Directive.scala b/core/src/main/scala/com/lightbend/paradox/markdown/Directive.scala index c7a6602d..bab81b96 100644 --- a/core/src/main/scala/com/lightbend/paradox/markdown/Directive.scala +++ b/core/src/main/scala/com/lightbend/paradox/markdown/Directive.scala @@ -770,7 +770,7 @@ case class DependencyDirective(ctx: Writer.Context) extends LeafBlockDirective(" def mvn(group: String, artifact: String, version: String, scope: Option[String], classifier: Option[String]): String = { val elements = - Seq("groupId" -> group, "artifactId" -> artifact, "version" -> { if (symbols.contains(version)) s"$${$version}" else version }) ++ + Seq("groupId" -> group, "artifactId" -> artifact, "version" -> { if (symbols.contains(version)) s"$${${dotted(version)}}" else version }) ++ classifier.map("classifier" -> _) ++ scope.map("scope" -> _) elements.map { case (element, value) => s" <$element>$value$element>" @@ -825,7 +825,7 @@ case class DependencyDirective(ctx: Writer.Context) extends LeafBlockDirective(" case "maven" | "Maven" | "mvn" => val symbolProperties = if (symbols.isEmpty) "" else symbolPostfixes.map { sp => - val symb = s"""${requiredCoordinate(VersionSymbol + sp)}""" + val symb = s"""${dotted(requiredCoordinate(VersionSymbol + sp))}""" s""" <$symb>${requiredCoordinate(VersionValue + sp)}</$symb>""" }.mkString("<properties>\n", "\n", "\n</properties>\n") val artifacts = dependencyPostfixes.map { dp => @@ -848,6 +848,8 @@ case class DependencyDirective(ctx: Writer.Context) extends LeafBlockDirective(" } printer.print("""""") } + + def dotted(symbol: String): String = symbol.replaceAll("(.)([A-Z])", "$1.$2").toLowerCase } case class IncludeDirective(ctx: Writer.Context) extends LeafBlockDirective("include") with SourceDirective { diff --git a/tests/src/test/scala/com/lightbend/paradox/markdown/DependencyDirectiveSpec.scala b/tests/src/test/scala/com/lightbend/paradox/markdown/DependencyDirectiveSpec.scala index 1a61926c..44d07e04 100644 --- a/tests/src/test/scala/com/lightbend/paradox/markdown/DependencyDirectiveSpec.scala +++ b/tests/src/test/scala/com/lightbend/paradox/markdown/DependencyDirectiveSpec.scala @@ -254,12 +254,12 @@ class DependencyDirectiveSpec extends MarkdownBaseSpec { |
|
|<properties>
- | <AkkaHttpVersion>10.1.0</AkkaHttpVersion>
+ | <akka.http.version>10.1.0</akka.http.version>
|</properties>
|<dependency>
| <groupId>com.typesafe.akka</groupId>
| <artifactId>akka-http_2.12</artifactId>
- | <version>$${AkkaHttpVersion}</version>
+ | <version>$${akka.http.version}</version>
|</dependency>
|
|
|
|<properties>
- | <AkkaVersion>2.5.29</AkkaVersion>
- | <AkkaHttpVersion>10.1.0</AkkaHttpVersion>
+ | <akka.version>2.5.29</akka.version>
+ | <akka.http.version>10.1.0</akka.http.version>
|</properties>
|<dependency>
| <groupId>com.typesafe.akka</groupId>
| <artifactId>akka-stream_2.12</artifactId>
- | <version>$${AkkaVersion}</version>
+ | <version>$${akka.version}</version>
|</dependency>
|<dependency>
| <groupId>com.typesafe.akka</groupId>
| <artifactId>akka-http_2.12</artifactId>
- | <version>$${AkkaHttpVersion}</version>
+ | <version>$${akka.http.version}</version>
|</dependency>
|
|