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

m2e plugin "looses" resources after changes pom.xml - using 2.4.100.20230827-1557 #1585

Closed
lihomev5 opened this issue Oct 25, 2023 · 7 comments

Comments

@lihomev5
Copy link

I am experiencing a problem with the m2e plugin in Eclipse. After making changes to my pom.xml, specifically adding or removing a dependency, the project's src/main/resources and src/test/resources files are not automatically copied to the target directory. However, when I right-click on the project and choose "Maven" > "Update Project..." the resources are properly copied to the target directory. This seems to be an issue with the automatic resource copying mechanism of m2e.

Version Information:

Eclipse Version: [2023-09 (4.29.0), Build id: 20230907-1323]
m2e Plugin Version: [Maven Integration for Eclipse 2.4.100.20230827-1557]
Maven Version: [3.9.4]
Operating System: [MacOS Monterey 12.7]

Steps to Reproduce:

Open an Eclipse Maven project.
Edit the pom.xml by adding or removing a dependency.
Observe that the src/main/resources and src/test/resources files are not copied to the target directory.
Right-click on the project, choose "Maven" > "Update Project..." and observe that the resources are now copied to the target directory.
Expected Behavior:
I expect that after modifying the pom.xml, the resources in src/main/resources and src/test/resources should be automatically copied to the target directory without the need to manually trigger "Update Project."

Actual Behavior:

The resources in src/main/resources and src/test/resources are not copied to the target directory automatically after modifying the pom.xml. Manual intervention by right-clicking on the project and updating it is required.

Additional Information:

There are no error messages or warnings in the Eclipse IDE.
I have verified that the Maven build process is configured correctly in the pom.xml.
This issue is affecting my workflow and productivity as it requires manual intervention each time I make a change to the pom.xml.
Possible Solutions:
I am not sure about the exact cause of this issue, but it seems like there might be an issue with the m2e plugin's automatic resource copying mechanism. It might be worth investigating the plugin's behavior in response to changes in the pom.xml.

Notes:

I have tested this issue on different projects and the problem persists.

@laeubi
Copy link
Member

laeubi commented Oct 25, 2023

This seems to be an issue with the automatic resource copying mechanism of m2e.

m2e does not copy anything, maven-resource-plugin does:

@tarioch
Copy link

tarioch commented Oct 25, 2023

I think this is a duplicate of #1511

@tarioch
Copy link

tarioch commented Oct 25, 2023

Right now the workaround we're having is to have a launcher which will touch all resource files. So basically after building, we'll then need to launch this and as now eclipse detects the files as modified, they will get copied over into the resources again.

@lihomev5
Copy link
Author

This seems to be an issue with the automatic resource copying mechanism of m2e.

m2e does not copy anything, maven-resource-plugin does:

I've downgraded the version to 2.1.2, and it is as normal as tarioch said.
just uninstall it, then use this url: "Eclipse IDE integration for Maven - https://download.eclipse.org/technology/m2e/releases/2.1.2" to install it.
I am using eclipse 2023-09 (4.29.0)

@fmarot
Copy link

fmarot commented Nov 21, 2023

my own workaround is to have a Maven launcher in Eclipse running "resources:resources" each time before launching my software. This is not ideal.

@HannesWell
Copy link
Contributor

I think this is a duplicate of #1511

I think so as well. I'll close this as duplicate of #1511.
Please follow that issue for updates. The good news is that @laeubi's PR to fix this up-stream makes good progress (apache/maven-filtering#77).

@HannesWell
Copy link
Contributor

Duplicate of #1511

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

No branches or pull requests

5 participants