See #212 -- it seems that when given a new File(relativePath), file.createNewFile() will create a file in a different place for SBT sub-projects and root-projects. Using new File(absolutePath) instead resolves this issue.
I'm not sure the best way to add test coverage for this, but it can be reproduced by:
creating an SBT project that has a sub-project and a root project both with .enablePlugins(ScalaPactPlugin).
creating a consumer pact in both projects and and running tests against them (sbt pactTest, assuming you .aggregate the sub-project in the root project)
you should see pact files get generated in the root target/pacts folder, as well as in subProject/target/pacts prior to this fix, and after this fix they should both be in the root target/pacts folder.
See #212 -- it seems that when given a
new File(relativePath)
,file.createNewFile()
will create a file in a different place for SBT sub-projects and root-projects. Usingnew File(absolutePath)
instead resolves this issue.I'm not sure the best way to add test coverage for this, but it can be reproduced by:
.enablePlugins(ScalaPactPlugin)
.sbt pactTest
, assuming you.aggregate
the sub-project in the root project)target/pacts
folder, as well as insubProject/target/pacts
prior to this fix, and after this fix they should both be in the roottarget/pacts
folder.