Hi All,
The Maven (I am using version 3.0.3) archetype "webapp-javaee6" doesn't create any test folder.
Also the WEB-INF/META-INF folders are not pre-created.
How would I test my application?
I have created a "test" folder under src/main but my test class is not getting invoked.
Thanks Jeanne. That helped. Now my Test class is getting invoked.
My question is:
Why didn't Maven create those test folders automatically?
But Maven did create test folders for simple "jar" kind of projects.
But for "webapp-javaee6" and "war" type it didn't.
If you use an archetype to create a project, then you get only what the designers of the archetype have provided. I have often found that many Java EE archetypes don't include the test directory structure. But there is nothing that says you can't create the directory yourself. My best suggestion is to create your own archetypes that contain everything you want. That's what I do, then I get a POM with all the settings that I want, a lot of boilerplate code, and lots of other things that I typically add to any of my web projects, all at the push of a button.
As per Maven's idea of "Convention over Configuration" why would Maven let developers decide where would they want the test folder?
These should be fixed as per Maven.
It's not a big deal, but anyway, thanks for your reply.
In Maven you can move any of the folders to different locations. But you do so at your own peril because some plugins are not as good as looking up the configured location, instead relying on the default location.
Also, the absence of a test directory doesn't mean that something is amiss. Perhaps the archetype authors assumed that it is too difficult (or not possible) to write unit tests for that kind of web app (yeah, bad assumption). There are a lot of other conventional directories that are also missing from most archetypes.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.