6 Replies Latest reply on Aug 9, 2011 12:02 PM by Lukáš Fryč

    M2E WTP and webResources

    Lukáš Fryč Master

      Hi guys,

       

      I'm curious if JBT are going to handle options of maven-war-plugin, in my case I miss webResources support [1]

      when developing RichFaces sample app [2].

       

      I would like to achieve changing of Deployment Assembly regarding to selected Maven profile.

      Currently I need to manage it manually.

       

      Should I create a feature request in JBIDE?

       

      [1] http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#webResources

      [2] https://github.com/richfaces/showcase

        • 1. Re: M2E WTP and webResources
          Fred Bricon Novice

          What version of m2e-wtp and JBT are you using?

          m2e-wtp 0.12.0, which enables webresources support works with JBT 3.2.x

          m2e-wtp 0.13.0, which is compatible with Indigo  works with JBT 3.3.x

           

          In any case, this is not a JBT issue but a m2e-wtp one, so if a bug report is needed, you should use https://issues.sonatype.org/browse/MECLIPSEWTP

          • 2. Re: M2E WTP and webResources
            Fred Bricon Novice

            I tried to build the showcase and there's an error with the resource filtering build participant. It doesn't like that you defined absolute targetPaths (starting with "/") for webresources. I made it work using :

             

            <webResources>
              <resource>
                <!-- this webresource can be dropped since no filtering is done here, it's
                 automatically included in the deployment.
                 Removing it would also spare a few CPU cycles from the resource filtering process.
                 --> 
                <directory>src/main/webapp</directory> 
              </resource>
              <resource>
                <directory>src/main/webapp-tomcat</directory>
              </resource>
              <resource>
                 <directory>src/main/java</directory>
                  <targetPath>WEB-INF/src</targetPath>
               </resource>
            </webResources>
            

             

            You can check the content of the web-resources folder under the "Deployed Resources" node, in the Project Explorer.

             

            This is definitely a m2e-wtp bug.

            • 3. Re: M2E WTP and webResources
              Lukáš Fryč Master

              Hi Fred,

               

              thanks for digging into!

               

              Configuration you mentioned does work when one webResources is configured in default profile,

               

              but it seems webResources does not work when using several profiles with different webResources configuration.

               

              When I select jbas7 profile in Project Propertries>Maven>Active Maven Profiles, it still shows in Deployed Resources/web-resources (and also deploys) web.xml from webapp-tomcat which I marked for complete exclusion.

              • 4. Re: M2E WTP and webResources
                Fred Bricon Novice

                Have you tried cleaning the project first? Resources copied from previous build are not deleted automatically (as it builds incrementally)

                1 of 1 people found this helpful
                • 5. Re: M2E WTP and webResources
                  Lukáš Fryč Master

                  You were right, Fred.

                   

                  Project>Clean do the trick!

                   

                  I have tried only Maven>Update Project Configuration which had no effect.

                   

                  Thanks again.

                  • 6. Re: M2E WTP and webResources
                    Lukáš Fryč Master

                    Hi Fred,

                     

                    I have tried to remove

                     

                    <directory>src/main/webapp</directory>

                     

                    as you suggested above,

                     

                    but when selecting jbas7 profile, WTP starts to copy contents of

                     

                    src/main/webapp-jee6

                    to

                    web-resources/WEB-INF/src

                     

                    so web.xml is misplaced in WEB-INF/src/WEB-INF/web.xml.

                     

                    This seems as very strange consequence, so I have tried several times with same result.