Skip to content
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

Add Maven Invoker Integration Test and Ensure Successful Build #451

Closed
wants to merge 0 commits into from

Conversation

SohamJuneja
Copy link
Contributor

Added a new integration test MavenInvokerIntegrationTest to validate Maven commands (clean and verify) using the Maven Invoker API.
Ensured the integration test runs successfully and verifies the build process.
Added the maven-invoker dependency to the plugin-modernizer-cli module for integration testing.
Updated the pom.xml in plugin-modernizer-cli to include required configurations for running tests.
Verified the project builds successfully with all tests passing.

@SohamJuneja
Copy link
Contributor Author

I noticed that the CI pipeline is failing due to the MavenInvokerIntegrationTest. I am investigating the root cause and will push updates shortly. The test works locally, but it seems to encounter issues in the CI environment

@SohamJuneja SohamJuneja marked this pull request as draft December 13, 2024 03:39
import java.io.File;
import java.util.Arrays;

public class MavenInvokerIntegrationTest {
Copy link
Collaborator

Choose a reason for hiding this comment

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

By default to be run by failsafe IT must match a certain pattern: https://maven.apache.org/surefire/maven-failsafe-plugin/examples/inclusion-exclusion.html#inclusions

public void testMavenGoalExecution() throws MavenInvocationException {
InvocationRequest request = new DefaultInvocationRequest();
request.setPomFile(new File("pom.xml"));
request.setGoals(Arrays.asList("clean", "verify"));
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should run not run clean verify on the root pom

But invoke something like mvn exec:exec -Dexec.executable="java".....` by running the CLI previously build and packaged in a previous phase

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

Successfully merging this pull request may close these issues.

2 participants