Results 1 to 6 of 6

Thread: ApplicationContext placement in eclipse maven project

  1. #1

    Question 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

  2. #2

    Talking

    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>

  3. #3

    Default

    Spoke to soon. This does not work

    So I ask again does anyone have any idea what I messed up here?

  4. #4
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    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?

  5. #5

    Default

    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

  6. #6
    Join Date
    Dec 2006
    Posts
    2

    Exclamation

    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
  •