This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes java classes not found in WEB-INF in maven build Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "java classes not found in WEB-INF in maven build" Watch "java classes not found in WEB-INF in maven build" New topic

java classes not found in WEB-INF in maven build

Subash Karuppaiah

Joined: Apr 27, 2012
Posts: 6
Hi am working on a project using flex and Java at the back end. Its a web-app project. The thing is when i compile it through Eclipse its well and good. But when i use maven to build the war, i don't get class files inside my WEB-INF\Classes folder. Had anyone come across with such a problem, i done get any errors, but still there is no class files.

I had attached my POM file here

I run "mvn install" plugin.Thanks in Advance!

E Armitage

Joined: Mar 17, 2012
Posts: 988
Maybe the <sourceDirectory>src/clv_web_flex/Mxmls</sourceDirectory> option isn't processing as you expect it to. Try putting the source files under the standard src/main/java folder and see if those get included.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16901

Well, first of all, don't expect things to go to WEB-INF\Classes, because this isn't a Windows filesystem, it's a WAR, and therefore the actual required destination is "WEB-INF/classes". Windows isn't case-sensitive in file naming, but Java most definitely is. And since a "true" WAR is a ZIP file, the Windows path syntax isn't technically correct.

Pedantry aside, people who attempt to force their own project structure on Maven tend to regret it. Frequently and with great feeling. The proper place to put class source code is under the project's src/main/java directory. The proper place to put fixed content is src/main/webapp. Maven's WAR plugin will then do the proper thing without any additional configuration or conflict with other Maven subsystems.

Customer surveys are for companies who didn't pay proper attention to begin with.
I agree. Here's the link:
subject: java classes not found in WEB-INF in maven build
It's not a secret anymore!