Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.
This repository was archived by the owner on Aug 21, 2025. It is now read-only.

Pact file output folders differ between SBT and tests for sub-projects #212

Description

@solarmosaic-kflorence

Currently ScalaPactEnv sets outputPath to None by default:

In various places, a default value of "target/pacts" is then assigned. For example:

val giveOutputPath: String = outputPath.getOrElse(Properties.envOrElse("pact.rootDir", "target/pacts"))

This results in the project root target/pacts folder being used by default, even for sub-projects. This means by default, pact commands will fail on sub-projects. I would suggest instead, we use a default of (target.value / "pacts").getPath as provided by SBT, for example:

scalaPactEnv := ScalaPactEnv.empty.withOutputPath((target.value / "pacts").getPath),

This way the default target path will work on sub-projects by default. This means we should probably also update the logic so that other places in the code will expect the outputPath to always be defined and used as a fallback to Properties.envOrElse("pact.rootDir") so that defining the system override will still take precedence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions