I have not read the whole message. But yes, the enforcer plugin does fail in
the
embedder (I believe it there is a JIRA issue), I ran into a similar thing.
So we ended
up putting the enforcer in a profile. 

Thanks,
mohan kr


-----Original Message-----
From: Rusty Wright [mailto:[email protected]] 
Sent: Wednesday, January 28, 2009 6:57 PM
To: [email protected]
Subject: Re: [m2eclipse-user] never ending problems with tomcat, eclipse,
and m2elipse

Well, it's working now but I'm not exactly sure what I did since I was doing
too many things at the same time, but I think it may have been because my
pom for waitlist-war had a <resources> section that was the same as the
parent's pom.  The waitlist-war pom had:

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>
        </plugins>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

And the parent pom; note that src/main/resources was also in the
testResources section but it's now commented out:

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <pluginManagement>
    ...
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>

            <testResource>
                <directory>src/test/java</directory>

                <filtering>true</filtering>

                <includes>
                    <include>**/*-context.xml</include>
                </includes>
            </testResource>

            <!--
            <testResource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </testResource>
            -->
        </testResources>
    </build>




Rusty Wright wrote:
> Nope; sorry.  All of the ones that were at 0.9.6 are now at 0.9.7.  I 
> removed all of them and restarted before adding the 0.9.7 ones from the 
> dev site.
> 
> Also tried Randy's voodoo of removing ** from Excluded for 
> src/main/resources in the build path window; still no cigar for him.
> 
> 
> Eugene Kuleshov wrote:
>>
>>  Have you tried it with the latest published dev build from update 
>> site at http://m2eclipse.sonatype.org/update-dev/ ?
>>
>>  regards,
>>  Eugene
>>
>>
>> Rusty Wright wrote:
>>> Under the Available Software tab in the Software Updates and Add-ons 
>>> window I found something called Web Developer Tools and checked its 
>>> box and let eclipse install it.  Also Java EE Developer Tools.  
>>> Restarted eclipse.
>>>
>>> But I failed to check and see if was already installed before I 
>>> installed it just now.  They're still there under the Available 
>>> Software tab, so eclipse doesn't take things out of that list after 
>>> you install them; they may have been already installed which I 
>>> suspect they were since I installed the j2ee version of eclipse.
>>>
>>> Anyhow, let's see what happens when I move the config folder back to 
>>> src/main/resources now ...
>>>
>>> Nope; same error.
>>>
>>> Let's try some voodoo; I'll remove that project and re-import it from 
>>> svn ...
>>>
>>> Nope; same error.
>>>
>>>
>>> Eugene Kuleshov wrote:
>>>> Rusty,
>>>>
>>>>  Can you please confirm what version of m2eclipse and what version 
>>>> of Eclipse WTP you are using? Also please confirm that you have 
>>>> "Maven integration for WTP" feature installed.
>>>>
>>>>  Thanks
>>>>
>>>>  Eugene
>>>>
>>>>
>>>> Rusty Wright wrote:
>>>>> Nice try Randy, but no cigar.  ;-)
>>>>>
>>>>> I first removed the Excluded: ** thing and that didn't help, then I 
>>>>> tried deleting top level of that in the Java Build Path; the 
>>>>> waitlist-war/src/main/resources so that it's not a source folder on 
>>>>> the build path (which it isn't), but that didn't help either.  Then 
>>>>> I tried deleting the .settings folder but that had the effect of 
>>>>> adding back the above two deletions.
>>>>>
>>>>> And after I did the above deletions I removed the project from the 
>>>>> server in the Servers tab and added it back (voodoo that's helped 
>>>>> in the past), but that didn't help either.
>>>>>
>>>>>
>>>>> Randy Burgess wrote:
>>>>>> If you check the build path of this project I'll bet you will see 
>>>>>> on the Source tab that resources will have Excluded: **. I have 
>>>>>> had the same issue and don't know why the build path gets changed 
>>>>>> like this. Just remove that filter and the resources will get put 
>>>>>> in the right place. Another way to fix this is to delete the 
>>>>>> projects .settings folder then on the m2eclipse context menu 
>>>>>> select "Update Project Configuration".
>>>>>>
>>>>>> Randy Burgess
>>>>>>
>>>>>> On 1/27/09, *Rusty Wright* <[email protected] 
>>>>>> <mailto:[email protected]>> wrote:
>>>>>>
>>>>>>     I'm not sure what I'm doing wrong but I've been spending way too
>>>>>>     much time trying to get this project off the ground.
>>>>>>
>>>>>>     The structure I'm trying to use is I have a main maven project,
>>>>>>     waitlist-parent, and it has 4 sub projects;
>>>>>>
>>>>>>       <artifactId>waitlist-parent</artifactId>
>>>>>>
>>>>>>       <modules>
>>>>>>           <module>../waitlist-core</module>
>>>>>>           <module>../waitlist-db</module>
>>>>>>           <module>../waitlist-web</module>
>>>>>>           <module>../waitlist-war</module>
>>>>>>       </modules>
>>>>>>
>>>>>>     Waitlist-core will be the business logic; it depends on 
>>>>>> waitlist-db
>>>>>>     which will be the database stuff.  Waitlist-web depends on
>>>>>>     waitlist-core.  Waitlist-web will be the M and C of MVC; the
>>>>>>     controllers and models (I'm using Spring MVC).  Waitlist-war 
>>>>>> will be
>>>>>>     the V of MVC; the jsp views.  Waitlist-parent has a packaging of
>>>>>>     pom, waitlist-core, waitlist-db, and waitlist-web hav a 
>>>>>> packaging of
>>>>>>     jar, and waitlist-war has a packaging of war.
>>>>>>
>>>>>>     At the moment the only code I have is some tests in 
>>>>>> waitlist-db to
>>>>>>     verify that I can connect to and pull stuff out of the database.
>>>>>>
>>>>>>     On my linux system, in a terminal window, if I go into
>>>>>>     waitlist-parent and do a mvn -Ptest package that produces a 
>>>>>> war file
>>>>>>     in waitlist-war/target, and if I mv that to ~tomcat/webapps it's
>>>>>>     deployed/started by tomcat without errors.
>>>>>>
>>>>>>     In eclipse I've set up a tomcat server and it's there in the 
>>>>>> Servers
>>>>>>     tab list (it's the only one).  If I add the waitlist-war 
>>>>>> project to
>>>>>>     it, unlike other simple web apps I've done before, it has a + 
>>>>>> next
>>>>>>     to it and opening that it shows waitlist-core, waitlist-db, and
>>>>>>     waitlist-web under waitlist-war; which makes sense since those 
>>>>>> are
>>>>>>     dependencies of waitlist-war.  When I click on the Publish to 
>>>>>> server
>>>>>>     button (next to the red Stop button) I kept getting this error:
>>>>>>
>>>>>>     Publishing failed
>>>>>>      File not found:
>>>>>>     
>>>>>>
C:\users\rusty\workspaces\waitlist01\waitlist-web\target\classes\META-INF\MA
NIFEST.MF. 
>>>>>>
>>>>>>      File not found:
>>>>>>     
>>>>>>
C:\users\rusty\workspaces\waitlist01\waitlist-core\target\classes\META-INF\M
ANIFEST.MF. 
>>>>>>
>>>>>>      File not found:
>>>>>>     
>>>>>>
C:\users\rusty\workspaces\waitlist01\waitlist-db\target\classes\META-INF\MAN
IFEST.MF. 
>>>>>>
>>>>>>
>>>>>>     But that's mysteriously stopped happening, so we can ignore 
>>>>>> that I
>>>>>>     suppose.
>>>>>>
>>>>>>     Now when I start tomcat in eclipse by clicking on the green 
>>>>>> circle
>>>>>>     arrow button it's complaining about not being able to find my 
>>>>>> Spring
>>>>>>     applicationContext.xml config file; in
>>>>>>     waitlist-war/src/main/webapp/WEB-INF is my web.xml, which 
>>>>>> contains
>>>>>>
>>>>>>       <context-param>
>>>>>>           <param-name>contextConfigLocation</param-name>
>>>>>>
>>>>>>           <param-value>
>>>>>>               classpath:config/applicationContext.xml
>>>>>>           </param-value>
>>>>>>       </context-param>
>>>>>>
>>>>>>     The file applicationContext.xml is in
>>>>>>     waitlist-war/src/main/resources/config (as are 
>>>>>> waitlist-servlet.xml
>>>>>>     and logback.xml, not that that matters).
>>>>>>
>>>>>>     Back on the linux machine, the .war file has these in the 
>>>>>> right place:
>>>>>>
>>>>>>        1706  01-26-09 17:45   WEB-INF/web.xml
>>>>>>         676  01-27-09 10:32   
>>>>>> WEB-INF/classes/config/applicationContext.xml
>>>>>>         914  01-27-09 10:32   WEB-INF/classes/config/logback.xml
>>>>>>        1101  01-27-09 10:32   
>>>>>> WEB-INF/classes/config/waitlist-servlet.xml
>>>>>>
>>>>>>     Here's the log output error for the errant file:
>>>>>>
>>>>>>     Jan 27, 2009 11:00:05 AM org.apache.catalina.core.StandardContext
>>>>>>     listenerStart
>>>>>>     SEVERE: Exception sending context initialized event to listener
>>>>>>     instance of class 
>>>>>> org.springframework.web.context.ContextLoaderListener
>>>>>>     org.springframework.beans.factory.BeanDefinitionStoreException:
>>>>>>     IOException parsing XML document from class path resource
>>>>>>     [config/applicationContext.xml]; nested exception is
>>>>>>     java.io.FileNotFoundException: class path resource
>>>>>>     [config/applicationContext.xml] cannot be opened because it 
>>>>>> does not
>>>>>>     exist
>>>>>>            at
>>>>>>     
>>>>>>
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefini
tions(XmlBeanDefinitionReader.java:349) 
>>>>>>
>>>>>>           etc.
>>>>>>
>>>>>>     So let's stop tomcat and try moving the
>>>>>>     waitlist-war/src/main/resources/config directory to
>>>>>>     waitlist-war/src/main/webapp/WEB-INF/classes, start tomcat, 
>>>>>> and see
>>>>>>     what happens ...  Hah!  Success!
>>>>>>
>>>>>>     So can someone explain to me why I was having these problems?
>>>>>>
>>>>>>     And feel free to comment (constructively hopefully) on my setup;
>>>>>>     it's a tad rococo and byzantine but it appeals to my eccentric
>>>>>>     tastes. ;-)
>>>>>>
>>>>>>     
>>>>>> ---------------------------------------------------------------------
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe from this list, please visit:
>>>>
>>>>    http://xircles.codehaus.org/manage_email
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>    http://xircles.codehaus.org/manage_email
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to