Skip to content

[MNG-8637] Pull out Standalone API from UTs #2226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 4, 2025
Merged

Conversation

gnodet
Copy link
Contributor

@gnodet gnodet commented Apr 3, 2025

JIRA issue: MNG-8637

This commit moves the Standalone API implementation from the test directory to the main source directory, making it available for reuse outside of tests.

The Standalone API provides a way to run Maven API in a standalone mode (without the full Maven environment), primarily for testing and specialized execution scenarios. This is now the proper way to utilize Maven 4 in MIMA-like scenarios.

Key changes:

  • Moved ApiRunner and RepositorySystemSupplier from test to main source
  • Added UnsupportedInStandaloneModeException for operations not supported in standalone mode
  • Added package-info.java with documentation for the standalone package

This commit moves the Standalone API implementation from the test directory to the main source directory, making it available for reuse outside of tests.

The Standalone API provides a way to run Maven API in a standalone mode (without the full Maven environment), primarily for testing and specialized execution scenarios. This is now the proper way to utilize Maven 4 in MIMA-like scenarios.

Key changes:
- Moved ApiRunner and RepositorySystemSupplier from test to main source
- Added UnsupportedInStandaloneModeException for operations not supported in standalone mode
- Added package-info.java with documentation for the standalone package
@gnodet gnodet added this to the 4.0.0-rc-4 milestone Apr 3, 2025
@gnodet
Copy link
Contributor Author

gnodet commented Apr 3, 2025

@cstamas do you want to have a look at resolver and see if that would work ?

@cstamas
Copy link
Member

cstamas commented Apr 3, 2025

@gnodet sure!

@@ -112,6 +112,22 @@ under the License.
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-impl</artifactId>
</dependency>
<dependency>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

am unsure are these deps really needed here, maybe only for test?

As if you make them required, you make apache transport or basic connector "mandatory". I'd rather put back these into test scope of maven-impl and let "mima-like use case" user pick deps he needs instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved out the transports and kept named locks and connectors, as they are really the only implementation. If needed, we can revisit later.

@cstamas
Copy link
Member

cstamas commented Apr 3, 2025

Not to mention: now if this pulled out, what happens to maven-testing supplier? Should they be the same?

@gnodet gnodet marked this pull request as draft April 3, 2025 13:33
@gnodet
Copy link
Contributor Author

gnodet commented Apr 3, 2025

Not to mention: now if this pulled out, what happens to maven-testing supplier? Should they be the same?

Maven testing uses mocks, so not really affected.

@gnodet gnodet marked this pull request as ready for review April 3, 2025 16:20
@gnodet gnodet merged commit ba93946 into apache:master Apr 4, 2025
13 checks passed
@jira-importer
Copy link
Collaborator

Resolve #9673

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants