Maven Problem (Tomcat Webapp-Directory-Compatible Output?)

Hi all,

I have problems compiling with maven. Actually, it compiles fine, but I don’t quite understand the output and always there is something missing.

“mvn site” creates some html, css and image files in target/site/

./target/site
./target/site/source-repository.html
./target/site/integration.html
./target/site/dependencies.html
./target/site/team-list.html
./target/site/index.html
./target/site/license.html
./target/site/project-info.html
./target/site/issue-tracking.html
./target/site/plugins.html
./target/site/project-summary.html
./target/site/mail-lists.html
./target/site/css
./target/site/css/site.css
./target/site/css/maven-theme.css
./target/site/css/maven-base.css
./target/site/css/print.css
./target/site/images
./target/site/images/collapsed.gif
./target/site/images/close.gif
./target/site/images/expanded.gif
./target/site/images/logos
./target/site/images/logos/maven-feather.png
./target/site/images/logos/build-by-maven-black.png
./target/site/images/logos/build-by-maven-white.png
./target/site/images/icon_error_sml.gif
./target/site/images/external.png
./target/site/images/icon_info_sml.gif
./target/site/images/icon_warning_sml.gif
./target/site/images/icon_success_sml.gif
./target/site/images/newwindow.png
./target/site/plugin-management.html

“mvn war:war” creates the server side (jar dependencies, class files, WEB-INF, …)

./target/VMPortal-1.0
./target/VMPortal-1.0/WEB-INF
./target/VMPortal-1.0/WEB-INF/lib
./target/VMPortal-1.0/WEB-INF/lib/vim25.jar
./target/VMPortal-1.0/WEB-INF/lib/log4j-1.2.16.jar
./target/VMPortal-1.0/WEB-INF/lib/guava-12.0.jar
./target/VMPortal-1.0/WEB-INF/lib/jsr305-1.3.9.jar
./target/VMPortal-1.0/WEB-INF/lib/vaadin-6.7.1.jar
./target/VMPortal-1.0/WEB-INF/classes
./target/VMPortal-1.0/WEB-INF/web.xml
./target/VMPortal-1.0/META-INF
./target/VMPortal-1.0/META-INF/context.xml
./target/VMPortal-1.0/META-INF/MANIFEST.MF
./target/VMPortal-1.0/images
./target/VMPortal-1.0/images/login_small.jpg
./target/VMPortal-1.0/images/login.jpg

“mvn package” creates a war-archive, but inside there are no html, css, image files

My problem is now, somehow it doesn’t fit together. I would like to get an output which is “tomcat-webapps-directory”-compatible.

That means, I would like to have something like:

./target
./target/source-repository.html
./target/integration.html
./target/dependencies.html
./target/team-list.html
./target/index.html
./target/license.html
./target/project-info.html
./target/issue-tracking.html
./target/plugins.html
./target/project-summary.html
./target/mail-lists.html
./target/css
./target/css/site.css
./target/css/maven-theme.css
./target/css/maven-base.css
./target/css/print.css
./target/images
./target/images/collapsed.gif
./target/images/close.gif
./target/images/expanded.gif
./target/images/logos
./target/images/logos/maven-feather.png
./target/images/logos/build-by-maven-black.png
./target/images/logos/build-by-maven-white.png
./target/images/icon_error_sml.gif
./target/images/external.png
./target/images/icon_info_sml.gif
./target/images/icon_warning_sml.gif
./target/images/icon_success_sml.gif
./target/images/newwindow.png
./target/plugin-management.html
./target/WEB-INF
./target/WEB-INF/lib
./target/WEB-INF/lib/vim25.jar
./target/WEB-INF/lib/log4j-1.2.16.jar
./target/WEB-INF/lib/guava-12.0.jar
./target/WEB-INF/lib/jsr305-1.3.9.jar
./target/WEB-INF/lib/vaadin-6.7.1.jar
./target/WEB-INF/classes
./target/WEB-INF/web.xml
./target/META-INF
./target/META-INF/context.xml
./target/META-INF/MANIFEST.MF
./target/images/login_small.jpg
./target/images/login.jpg

Does someone know what goal I have to give maven in order to get a tomcat-compatible webapp directory?

Thank you in advance!

All the best,
Thomas

If your maven project is set up correctly, a simple “mvn clean package” should be all you need.

You may want to read the
maven web site
for more info, but
here’s an example
you can use to get going (ignore the actual app though – it’s an April Fool’s Day post). I’ve seen other pom.xml files that produce web apps with less xml in there, but I’m not a maven guy so I don’t know what the differences were.

Cheers,
Bobby