MaxonT opened a new pull request, #270:
URL: https://github.com/apache/maven-changelog-plugin/pull/270
Hey, this moves the changelog plugin off the Maven API that has been
deprecated since Maven 3, which is what issue #269 is about; please check that
I caught every spot.
### Description
`AbstractChangeLogReportTest` mocked the deprecated
`org.apache.maven.artifact.repository.ArtifactRepository` and fed it to
`DefaultRepositorySystemSessionFactory` through a `MavenExecutionRequest`, only
to get a repository session with `target/local-repo` as its local repository.
This change builds that session directly instead:
`MavenRepositorySystemUtils.newSession()` plus a `LocalRepositoryManager` from
the injected `RepositorySystem`, pointing at the same `target/local-repo`
directory. `mavenSession.getRepositorySession()` still returns a real session
with the same local repository directory. The session is plainer than before:
it no longer goes through the request and settings handling of the old factory
(mirrors, proxies, offline mode), which this test never configured, and the 25
tests pass without it.
`maven-artifact` was only declared as a test dependency for that import, so
`dependency:analyze` flagged it as unused once the import was gone. I replaced
it with `maven-resolver-provider` (test scope, same `${mavenVersion}`), which
`MavenRepositorySystemUtils` comes from. Nothing under `src/main` is touched.
### Validation
`mvn verify` on this head: exit 0 (25 unit tests, plus the dependency
analysis and the other checks bound to `verify`). The same command on the
unchanged `master` also exits 0. I did not run the integration tests separately
beyond what `verify` runs by default. The build ran with JDK 23 and Maven 3.9.9
on macOS; I did not try other JDKs.
Closes #269. Part of apache/maven#14157.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]