Maven: follow a custom `<testSourceDirectory>`

Open
#163 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript

Research direction

Start in src/repo/adapters/maven.ts and inspect how custom source roots trigger the full-validation blocker. Find the Maven adapter tests and synthetic fixtures under tests/repo/, then add cases for a resolvable custom test root, a custom source root, and an unresolved or outside-module test root. Run npm test; done means only the resolvable test-root case avoids fallback, while the other two still fall back for the stated reason.

Written by the indexing model from the issue text.

Description

adapter help wanted

Part of #89 (the "Follow custom <sourceDirectory> and <testSourceDirectory> roots" step), split out so it can be done on its own.

Today any custom source root makes the Maven adapter fall back to the full suite: src/repo/adapters/maven.ts sets customSourceRoots when a POM's <sourceDirectory> isn't src/main/java or its <testSourceDirectory> isn't src/test/java, and that adds the blocker Maven <pom>: custom source roots require full validation.

The test root alone is the smaller half: it only changes where tests are found, not how modules depend on each other.

Done when:

  • A module whose only customization is <testSourceDirectory> finds its tests there and no longer falls back for that reason.
  • A custom <sourceDirectory> still falls back, with the same reason as today.
  • A <testSourceDirectory> the adapter can't resolve with certainty (a property such as ${project.basedir}/..., or a path outside the module) still falls back. Never guess.
  • There are synthetic Maven fixtures under tests/repo/ for each case above.

maven.ts is 128 lines. This is a step up from a good first issue: it suits someone who has already merged a PR or two here.


See CONTRIBUTING.md: add a synthetic fixture, run npm test, and sign off commits with git commit -s. Comment here to claim the issue.

Dominant language
TypeScript
Stars
0
Forks
4
Avg merge
18h 41m
Merged PRs (30d)
48

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DiffCI/core

All issues in DiffCI/core

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.