Obtaining Web Module Deployment Descriptor path from maven pom.xml

Hi,

I have a web application MY_WEBAPP that uses maven. I am able to open the maven pom.xml from IDEA 10.0.3 and locally start Tomcat from within IDEA to run this web application, after performing the following configuration steps:

  1. Open the "Project Structure" in IDEA (STRG+ALT+UMSCH+S)
  2. Select "Project" on the left hand side and check if the Project SDK is set properly. If not push "New" and select your C:\Tools\jdk1.6.0_16 directory as the JSDK home
  3. Click on "Facets", chose "Web"
  4. Click on the plus to add a new Facet
  5. Choose module "MY_WEBAPP"
    1. For the Web Module Deployment Descriptor, choose "c:\...MY_WEBAPP\src\main\webapp\WEB-INF\web.xml"
    2. For the Web Resource Directory, set C:\...MY_WEBAPP\src\main\webapp
    3. Click on "Add Application Server specific descriptor", choose Tomcat and set "C:\...MY_WEBAPP\src\main\webapp\META-INF\context.xml" as the path
  6. Click on "Fix" to add the facet to a new artifact
    1. Set the Output directory to "C:\...MY_WEBAPP\exploded"
    2. Click on "Fix", then "Add all missing dependencies..."
    3. Click on "Fix", then on "Add Maven-backport..."


Every time I check out a branch of my web application and want to open that branch in IDEA, I have to perform the above steps again. This is very tedious. I now tried providing the "Web Module Deployment Descriptor" by specifying, in my pom.xml:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                                        ...
                    <webXml>${basedir}/src/main/webapp/WEB-INF/web.xml</webXml>
                </configuration>
            </plugin>
I also tried
            <webXml>src/main/webapp/WEB-INF/web.xml</webXml>
however, IDEA by default keeps setting the Web Module Deployment Descriptor to C:\...MY_WEBAPP\web\WEB-INF\web.xml, so I still have to do the manual configuration whenever I try to open a new branch in IDEA.



Is there any way around this problem *except* by adding the IDEA project files to my repository/branches?

Thank you very much!

Please sign in to leave a comment.