Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Test sources and resources are being packaged

Fred, right now I'm stick with 0.11.x because I can olny update m2e version after planning to do so with all other developers (and we are a distributed team, so we need more time for that).

I updated project configuration (again) and it now works, but let me try to explain the long version of the story (maybe you can figure out what really happened because it´s now working, but I still can´t know why it was a problem before):

1. I had testSourceDirectory and testResources configured in a parent pom.xml since months but in the child ejb module there was not any tests (the folders in this module did not even exist until last week - too bad, I know, but unfortunately the manager was not treating the tests as they deserve);

2. Last week I started writing unit tests for this module and so I created the folders (through windows explorer) and then I'm absolutely sure I used maven > update project configuration .. I'm sure because only after doing this I became able to see those created test folders as source folders inside Eclipse;

3. Then I spent the whole week only writing tests and didn't try to deploy the project to the server. Yesterday, when I was finished in writing tests, I tried to deploy and then noticed test sources were also being deployed through m2e (even after I had already updated project configuration). Then I sent previous email to the list reporting the behavior.

4. Now we are in the present. I followed your instructions and checked that ModuleCoreNature was already present in the ejb module .project and the test source entries were actually referenced on my ejbproject/.settings/org.eclipse.wst.common.component

5. Remember: I had already updated project configuration last week to start writing the tests and still test sources were being deployed. But now what may be strange is that after updating project configuration again, the test source entries were removed from org.eclipse.wst.common.component and now m2e is working as expected (not deploying test sources).

I don't know what I may have done to dirty eclipse configuraton files while I was writing the tests, so I don't know if it will be possible to catch this "bug" (if there is really any) at this moment. From now on, I'll be writing more tests and I'll be deploying to the server and if I notice the error again and if I have more information that might be helpful, then I'll bring it back to you.


On Wed, Aug 31, 2011 at 5:36 PM, Fred Bricon <fbricon@xxxxxxxxx> wrote:
Your ejbproject/.settings/org.eclipse.wst.common.component most likely refernces the test source folders.

That was fixed in m2e-wtp 0.12.0 (which is compatible with m2e-core 0.12.x). See [1] and [2].
If you're stuck with 0.11.0, then I suggest you open your EJB module .project file, and check for the presence of this line :

Add it if it's missing. After that, update the project maven configuration and check if the offending entries have been removed from org.eclipse.wst.common.component.

If the ModuleCoreNature is present AND you still see these test source entries in org.eclipse.wst.common.component after updating the maven config then :
1 - Create a new issue in and attach your project there (only pom.xml + eclipse config files, obfuscate any sensible data if needed)
2 - manually remove the test entries from org.eclipse.wst.common.component and try deploying your app


Fred Bricon


2011/8/31 Rafael Vanderlei <rafaelvanderlei@xxxxxxxxx>
I'm still using Helios, m2e-core 0.12.x and m2e-wtp 0.11.x and I'm having problems because files under testSourceDirectory and testResources (I'm not using standard directory for test [re]sources) are being packaged and deployed to the application server.

Running mvn package works as expected (files under test directories don't get deployed)

I also noticed it´s only happening on the modules with ejb packaging type. Modules with jar packaging are deployed correctly, without test resources. Would it be a bug?

If you need, I can attach a test project to help you reproduce the error.

Thanks and regards,

m2e-users mailing list

"Have you tried turning it off and on again" - The IT Crowd

m2e-users mailing list

Back to the top