-
Mar 13th, 2007, 06:18 PM
#1
ApplicationContext placement in eclipse maven project
What is the correct placement for the applicationContext in a maven eclipse project?
I have a standard maven directory structure and the applicationContext is in the src/main/resource directory.
During compilation I get a class not found for my all of my bean classes. This worked perfectly before I changed the directory structure.
I can't imagine I have to augment my packages with src/main/resource
-
Mar 13th, 2007, 08:17 PM
#2
Answered my own question
I had forgotten to add the resource filters. I had wondered what those were for. I guess they are to keep developers humble
<resources>
<resource>
<targetPath>META-INF</targetPath>
<filtering>false</filtering>
<directory>${basedir}/src/main/META-INF</directory>
<includes>
<include>*.*</include>
</includes>
</resource>
<resource>
<targetPath>WEB-INF</targetPath>
<filtering>false</filtering>
<directory>${basedir}/src/main/WEB-INF</directory>
<includes>
<include>*.*</include>
</includes>
</resource>
</resources>
-
Mar 15th, 2007, 09:49 AM
#3
Spoke to soon. This does not work
So I ask again does anyone have any idea what I messed up here?
-
Mar 17th, 2007, 05:37 PM
#4
I don't think I understand what you are trying to do. You are writing a web application, and want to know where the ContextLoaderListener is going to find an application context? Or you just want to put something in the classpath?
If the former, then you would be looking for servlet context parameters defined in src/main/webapp/WEB-INF/web.xml. If the latter, note that the usual naming convention for maven2 is src/main/resources, so either you spelled it wrong in the post or in the project?
-
Mar 18th, 2007, 08:59 PM
#5
I may have been the spelling mistake I am embarrassed to say.
I ma having some other eclipse/maven issues that I will post elsewhere but will close this thread if it was the cause
Thanks Dave
-
Mar 26th, 2007, 08:30 AM
#6
Hi,
you need only to put all web-related files in src/main/webapp/WEB-INF
then maven will package it in your WAR-File.
best regards
mr_di
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules