diff --git a/sbt/src/sbt-test/dependency-management/pom-parent-pom/build.sbt b/sbt/src/sbt-test/dependency-management/pom-parent-pom/build.sbt index 53d830e83..82e17b0ab 100644 --- a/sbt/src/sbt-test/dependency-management/pom-parent-pom/build.sbt +++ b/sbt/src/sbt-test/dependency-management/pom-parent-pom/build.sbt @@ -10,6 +10,8 @@ resolvers += libraryDependencies += "com.example" % "example-child" % "1.0-SNAPSHOT" +libraryDependencies += "org.apache.geronimo.specs" % "geronimo-jta_1.1_spec" % "1.1.1" + version := "1.0-SNAPSHOT" @@ -20,3 +22,18 @@ cleanExampleCache := { IO.delete(cacheDir / "com.example") } } + +val checkIvyXml = taskKey[Unit]("Checks the ivy.xml transform was correct") + +checkIvyXml := { + ivySbt.value.withIvy(streams.value.log) { ivy => + val cacheDir = ivy.getSettings.getDefaultRepositoryCacheBasedir + // TODO - Is this actually ok? + val xmlFile = + cacheDir / "org.apache.geronimo.specs" / "geronimo-jta_1.1_spec" / "ivy-1.1.1.xml" + //cacheDir / "com.example" / "example-child" / "ivy-1.0-SNAPSHOT.xml" + val lines = IO.read(xmlFile) + if(lines.isEmpty) sys.error(s"Unable to read $xmlFile, could not resolve geronimo...") + assert(lines contains "xmlns:e", s"Failed to appropriately modify ivy.xml file for sbt extra attributes!\n$lines") + } +} diff --git a/sbt/src/sbt-test/dependency-management/pom-parent-pom/test b/sbt/src/sbt-test/dependency-management/pom-parent-pom/test index c0f560f2f..368146c24 100644 --- a/sbt/src/sbt-test/dependency-management/pom-parent-pom/test +++ b/sbt/src/sbt-test/dependency-management/pom-parent-pom/test @@ -1,2 +1,4 @@ > cleanExampleCache -> update \ No newline at end of file +> update +> checkIvyXml +-> resolv \ No newline at end of file