cvogt / cbt

CBT - fun, fast, intuitive, compositional, statically checked builds written in Scala
Other
488 stars 60 forks source link

Issue with substituting recursive pom variables #434

Open PiotrTrzpil opened 7 years ago

PiotrTrzpil commented 7 years ago

Hi, the following build fails:

package cluster_service_build
import cbt._
class Build(val context: Context) extends BaseBuild {
  override def dependencies = (
    super.dependencies ++
    Resolver( mavenCentral, sonatypeReleases ).bind(
      "com.amazonaws" % "aws-java-sdk-s3" % "1.11.86"
    )
  )
}

Error:

Caused by: java.lang.IllegalArgumentException: named capturing group is missing trailing '}'
        at java.util.regex.Matcher.appendReplacement(Matcher.java:841)
        at scala.util.matching.Regex$Replacement$class.replace(Regex.scala:804)
        at scala.util.matching.Regex$MatchIterator$$anon$1.replace(Regex.scala:782)
        at scala.util.matching.Regex$$anonfun$replaceAllIn$1.apply(Regex.scala:473)
        at scala.util.matching.Regex$$anonfun$replaceAllIn$1.apply(Regex.scala:473)
        at scala.collection.Iterator$class.foreach(Iterator.scala:893)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
        at scala.util.matching.Regex.replaceAllIn(Regex.scala:473)
        at cbt.BoundMavenDependency$$anonfun$lookup$1.apply(resolver.scala:402)
        at cbt.BoundMavenDependency$$anonfun$lookup$1.apply(resolver.scala:400)

This happens when substituting pom variable: ${awsjavasdk.version}, because it's being replaced with another variable: ${project.version}, so a recursive substitution is needed.

PR: https://github.com/cvogt/cbt/pull/433

cvogt commented 7 years ago

Bug report with a pull request. Awesome :). Fixed in master.

PiotrTrzpil commented 7 years ago

Great :)