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

[#502] : delete episodeFile if only file generated in configuration phase of m2e #503

Closed

Conversation

laurentschoelens
Copy link
Collaborator

Fixes #502

Does not break build
Tested in eclipse m2e sample project provided here

Copy link
Collaborator

@mattrpav mattrpav left a comment

Choose a reason for hiding this comment

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

Is there a command line procedure that could create this scenario?

@mattrpav
Copy link
Collaborator

Can we add the example project as a test and validate the episode is deleted?

@@ -479,6 +481,7 @@ protected void doExecute() throws MojoExecutionException {
setupDirectories();
doExecute(options);
addIfExistsToEpisodeSchemaBindings();
deleteEpisodeIfOnlyFileOnEmptyContext();

Choose a reason for hiding this comment

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

Wouldn't it be better to just not call doExecute instead of creating and then deleting the file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@alerosmile : there is some scenario (simple ones with no bindings / catalog) where files are just created the right way

Choose a reason for hiding this comment

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

@laurentschoelens : You are right but I once read this:
https://www.eclipse.org/lists/m2e-dev/msg01178.html

maven-resources-plugin:copy-resources does nothing during onConfiguration.

Copy link
Collaborator Author

@laurentschoelens laurentschoelens Feb 15, 2024

Choose a reason for hiding this comment

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

So you suggest that the runOnConfiguration should be set to false ?

Choose a reason for hiding this comment

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

No, the source roots must be added during runOnConfiguration, but according to Igor's comment, no files should be created. I'm not sure but I think Igor is one of the main creator of m2e.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In fact, it's working as expected with only runOnIncremental 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In fact, it's working as expected with only runOnIncremental 😄

Or not 😄

@laurentschoelens
Copy link
Collaborator Author

Is there a command line procedure that could create this scenario?

I don't think so sadly 😞

@laurentschoelens
Copy link
Collaborator Author

Can we add the example project as a test and validate the episode is deleted?

No : the problem is only in m2e 😞

@mattrpav
Copy link
Collaborator

See other test failures-- did this change cause a regression?

@laurentschoelens
Copy link
Collaborator Author

image

Output maven console after the fix

@mattrpav
Copy link
Collaborator

Thoughts on guarding this change with a config flag or state flag that detects we are running in Eclipse / m2e?

@laurentschoelens
Copy link
Collaborator Author

Thoughts on guarding this change with a config flag or state flag that detects we are running in Eclipse / m2e?

BuildContext is null on non eclipse-m2e build

@laurentschoelens
Copy link
Collaborator Author

See other test failures-- did this change cause a regression?

No, see f574786 (fixed in other PR)

@laurentschoelens
Copy link
Collaborator Author

Closing, will recreate new one with another fix

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.

3 participants