Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] (m2e-wtp) RunOnServer Bypasses Resource Filtering

For 1, my org.eclipse.wst.common.component looks exactly like that
(except the project name of course).

And I did 2 and 3 at the same time:

. Remove the project.
. Check out the project from the version control repository as a Maven
  project.
. Run the project on Tomcat 6 (previously it's a Tomcat 7 server
  runtime).

And it worked! Not only it worked for the Tomcat 6 server, it worked for
the Tomcat 7 as well.

Now that I think about it, it's probably my own fault. To avoid seeing
some warnings generated by files under /target, I put a filter on the
folder, and that filter may have prevented the correct files from being
copied to the deployment directory.

Anyways, thank you Fred very much for your help. Have a great weekend!

- Chengyu

On 8/13/2011 11:01 AM, Fred Bricon wrote:
Your <project>./settings/org.eclipse.wst.common.component should look like :

/<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="webproject">
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes"
source-path="/src/main/resources"/>
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
         ... references to other projects ...
<property name="context-root" value="//webproject//"/>
<property name="java-output-path" value="/web/target/classes"/>
</wb-module>
</project-modules>

/Have you tried removing any existing eclipse project metadata files
(.project, .classpath, ./settings/*) and reimport the project as a maven
project?
Have you tried creating a new server instance?
What happens if you export the project as a war archive in eclipse?

2011/8/13 Chengyu Sun <csun@xxxxxxxxxxxxxx <mailto:csun@xxxxxxxxxxxxxx>>

    I've tried the server clean, the Project -> Clean ..., and restarting
    Eclipse (remove the project from the server, exit Eclipse, delete
    any leftover in the Eclipse work directory, restart Eclipse and
    run-on-server again) but none worked. It seems like the deployment
    process simply ignored /target (but then I wonder where it got
    the class files).

    Thanks a lot,

    - Chengyu


    On 8/13/2011 10:39 AM, Fred Bricon wrote:

        If you see the resources correctly filtered under target/classes and
        target/m2e-wtp/web-resources/ then m2e-wtp has done the job right.
        So there's probably an issue with the server adapter.
        Have you tried running the "clean" command on tomcat in the
        server view
        (assuming it's tomcat)? Have you tried restarting Eclipse?

        2011/8/13 Chengyu Sun <csun@xxxxxxxxxxxxxx
        <mailto:csun@xxxxxxxxxxxxxx> <mailto:csun@xxxxxxxxxxxxxx
        <mailto:csun@xxxxxxxxxxxxxx>>>


            Hello,

            I'm using Eclipse 3.7, m2e 1.0.0.20110607-2117, and
            m2e-wtp 0.13.1.20110728-1800. I have a project with some Spring
            bean definition file at
        src/main/resources/META-INF/____spring-data.xml
            which looks like this:

        <bean id="dataSource"
        class="org.apache.commons.____dbcp.BasicDataSource"
              destroy-method="close">
        <property name="url" value="${db.url}" />
        <property name="username" value="${db.username}" />
        <property name="password" value="${db.password}" />
        <property name="initialSize" value="1" />
        <property name="maxActive" value="20" />
        </bean>

            In pom.xml I've set up resource filtering to put in the actual
            database connection info.

            When I tried "Run As -> Run on Server" in Eclipse, it didn't
        work.
            I noticed that the resource filtering did not happen when the
            project was deployed to Eclipse's work directory -

          .metadata\.plugins\org.____eclipse.wst.server.core\tmp0\____wtpwebapps\myproject;
            however, under ProjectDirectory/target/____classes the
        resource was
            filtered correctly. The same thing happened when filtering some
            web resources under WEB-INF with maven-war-plugin's webResources
            filtering - the filtering was done properly under
            target/m2e-wtp/web-resources/____WEB-INF but didn't happen under
            Eclipse's work directory.

            So my question is did I do something wrong or is this a bug?

            Thanks a lot,

            - Chengyu
            ___________________________________________________
            m2e-users mailing list
        m2e-users@xxxxxxxxxxx <mailto:m2e-users@xxxxxxxxxxx>
        <mailto:m2e-users@xxxxxxxxxxx <mailto:m2e-users@xxxxxxxxxxx>>

        https://dev.eclipse.org/____mailman/listinfo/m2e-users
        <https://dev.eclipse.org/__mailman/listinfo/m2e-users>
        <https://dev.eclipse.org/__mailman/listinfo/m2e-users
        <https://dev.eclipse.org/mailman/listinfo/m2e-users>>




        --
        "Have you tried turning it off and on again" - The IT Crowd



        _________________________________________________
        m2e-users mailing list
        m2e-users@xxxxxxxxxxx <mailto:m2e-users@xxxxxxxxxxx>
        https://dev.eclipse.org/__mailman/listinfo/m2e-users
        <https://dev.eclipse.org/mailman/listinfo/m2e-users>

    _________________________________________________
    m2e-users mailing list
    m2e-users@xxxxxxxxxxx <mailto:m2e-users@xxxxxxxxxxx>
    https://dev.eclipse.org/__mailman/listinfo/m2e-users
    <https://dev.eclipse.org/mailman/listinfo/m2e-users>




--
"Have you tried turning it off and on again" - The IT Crowd



_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users


Back to the top