Falko Modler opened MRRESOURCES-81 and commented
Scenario:
Some project bundles a file named META-INF/beans.xml.
Another project wants to use that file for its tests, so it sets <attachToMain>false</attachToMain> and <attachToTest>true</attachToTest>. Now let's assume that this project also has a file named META-INF/beans.xml under src/main/resources.
My assumption - especially when using <attachToMain>false</attachToMain> - is that everything should be fine: the beans.xml from the bundle should not be conflicting with the one from the main branch of the project that wants to use the bundled file.
But this is what happens instead: The file from src/main/resources ends up in maven-shared-archive-resources, not the one from the bundle.
The problem is caused by the way existing project resources are seemingly preferred over the bundled resources from the user defined artifact (and are even copied to the output directory). From a user perspective, this is not what I want. See also ProcessRemoteResourcesMojo.copyResourceIfExists(...).
A possible fix might be to introduce a new property like preferProjectResources which can be set to false (which should be the default value in my opinion, would break backwards compatibility though).
Affects: 1.5
Attachments:
Falko Modler opened MRRESOURCES-81 and commented
Scenario:
Some project bundles a file named
META-INF/beans.xml.Another project wants to use that file for its tests, so it sets
<attachToMain>false</attachToMain>and<attachToTest>true</attachToTest>. Now let's assume that this project also has a file namedMETA-INF/beans.xmlundersrc/main/resources.My assumption - especially when using
<attachToMain>false</attachToMain>- is that everything should be fine: the beans.xml from the bundle should not be conflicting with the one from the main branch of the project that wants to use the bundled file.But this is what happens instead: The file from
src/main/resourcesends up inmaven-shared-archive-resources, not the one from the bundle.The problem is caused by the way existing project resources are seemingly preferred over the bundled resources from the user defined artifact (and are even copied to the output directory). From a user perspective, this is not what I want. See also
ProcessRemoteResourcesMojo.copyResourceIfExists(...).A possible fix might be to introduce a new property like
preferProjectResourceswhich can be set tofalse(which should be the default value in my opinion, would break backwards compatibility though).Affects: 1.5
Attachments: