Maven: Including a META-INF folder in the classes folder?

In general for a Java-based Maven project, non source files should go in the src/main/resources sub-directory of the project. The contents of the resources directory are copied to the output directory (by default target/classes) in the process-resources phase of the build.

In general for a Java-based Maven project, non source files should go in the src/main/resources sub-directory of the project. The contents of the resources directory are copied to the output directory (by default target/classes) in the process-resources phase of the build. For war projects it is slightly more complicated, there is also the src/main/webapp directory, where Maven expects to find WEB-INF/web.xml.

For your war to build that file must exist or you'll see an error message like this: INFO ------------------------------------------------------------------------ ERROR BUILD ERROR INFO ------------------------------------------------------------------------ INFO Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web. Xml if executing in update mode) As the WEB-INF direcory must exist under src/main/webapp, I'd recommend avoiding defining it again in src/main/resources. Although this is perfectly valid and the contents of the two directories will be merged, it can get confusing if a file is defined in both.

The contents of src/main/resources will take precedence as they are copied over the top of the contents from src/main/webapp.

1 I love you man! – willcodejavaforfood Oct 22 '10 at 14:53 Your post solve my bug! Thanks!

Up for you! – Castanho Feb 15 at 1:07 So did mine, good job buddy – myro Nov 30 at 9:45.

Maven wants this type of information in the resources folder. See here for more information. Project |-- pom.

Xml `-- src `-- main |-- java `-- resources For specifying additional resource directories, see here.

I'll indirectly answer your question by saying that if you've already made the jump to Maven2 I'd definitely recommend using the Archetype Plugin. Using the webapp archetype will ensure you end up with a canonical directory structure. Anyone else looking at your source will immediiately know where everything is and there won't be any question as to where your files go.

Give the below entry in POM. Xml org.apache.maven. Plugins maven-war-plugin 2.1.1 **/web.xml.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions