Le dim. 15 juin 2025, 12:53, Claude Warren <cla...@xenei.com> a écrit :

> I am trying to figure out how to structure a project so that the following
> is possible.
>
> Logical structure
>
> core
>   +-- main
>   +-- test-fixtures
>   +-- test (uses test-fixtures)
>
> tools
>   +-- main (uses core)
>   +-- test (uses test-fixtures)
>
> component1
>   +-- main (uses tools to generate some code, uses core)
>   +-- test (uses test-fixtures)
>
> component2
>   +-- main (uses tools to generate some code, uses core)
>   +-- test (uses test-fixtures)
>
> The problem I have is that I can not get the test-fixtures to be accessible
> to the tools or components build when there is not already a jar built.
>
> Gradle has a solution where the core would be built, then the
> text-fixtures, then the core test.  But there does not seem to be a way to
> achieve the logical test-fixtures component.
>
> Does anyone have a suggestion for how to solve this problem?
>

Afaict you need to, either:
- split test fixtures and core tests into separate projects
- make sure you build the test fixtures jar early so it's available to the
reactor build (but are running at least up to the package phase? "mvn test"
is an anti-pattern in a multiproject build if you ask me); but this is not
"the maven way"
- maybe put test fixtures in src/test, and configure the test-jar to filter
out non-fixtures classes (again, I'd say it's not "the maven way")

>

Reply via email to