*/
    private void addWebModule( Element module )
    {
        // TODO: this is bad - reproducing war plugin defaults, etc!
        //   --> this is where the OGNL out of a plugin would be helpful as we could run package first and
        //       grab stuff from the mojo

        String warWebapp = executedProject.getBuild().getDirectory() + "/" + executedProject.getArtifactId();
        String warSrc = getPluginSetting( "maven-war-plugin", "warSourceDirectory", "src/main/webapp" );
        String webXml = warSrc + "/WEB-INF/web.xml";

        module.addAttribute( "type", "J2EE_WEB_MODULE" );

        Element component = findComponent( module, "WebModuleBuildComponent" );
        Element setting = findSetting( component, "EXPLODED_URL" );
        setting.addAttribute( "value", getModuleFileUrl( warWebapp ) );

        component = findComponent( module, "WebModuleProperties" );

        removeOldElements( component, "containerElement" );
        List artifacts = executedProject.getTestArtifacts();
        for ( Iterator i = artifacts.iterator(); i.hasNext(); )
        {
            Artifact artifact = (Artifact) i.next();

            Element containerElement = createElement( component, "containerElement" );

            if ( linkModules && isReactorProject( artifact.getGroupId(), artifact.getArtifactId() ) )
            {
                containerElement.addAttribute( "type", "module" );
                containerElement.addAttribute( "name", artifact.getArtifactId() );
                Element methodAttribute = createElement( containerElement, "attribute" );
                methodAttribute.addAttribute( "name", "method" );
                methodAttribute.addAttribute( "value", "5" );
                Element uriAttribute = createElement( containerElement, "attribute" );
                uriAttribute.addAttribute( "name", "URI" );
                uriAttribute.addAttribute( "value", "/WEB-INF/lib/" + artifact.getArtifactId() + "-"
                    + artifact.getVersion() + ".jar" );
            }
            else if ( artifact.getFile() != null )
            {
                containerElement.addAttribute( "type", "library" );
                containerElement.addAttribute( "level", "module" );
                Element methodAttribute = createElement( containerElement, "attribute" );
                methodAttribute.addAttribute( "name", "method" );
                if ( Artifact.SCOPE_PROVIDED.equalsIgnoreCase( artifact.getScope() )
                    || Artifact.SCOPE_SYSTEM.equalsIgnoreCase( artifact.getScope() )
                    || Artifact.SCOPE_TEST.equalsIgnoreCase( artifact.getScope() ) )
                {
                    // If scope is provided, system or test - do not package.
                    methodAttribute.addAttribute( "value", "0" );
                }
                else
                {
                    methodAttribute.addAttribute( "value", "1" ); // IntelliJ 5.0.2 is bugged and doesn't read it
                }
                Element uriAttribute = createElement( containerElement, "attribute" );
                uriAttribute.addAttribute( "name", "URI" );
                uriAttribute.addAttribute( "value", "/WEB-INF/lib/" + artifact.getFile().getName() );
                Element url = createElement( containerElement, "url" );
                url.setText( getLibraryUrl( artifact ) );
            }
        }

        addDeploymentDescriptor( component, "web.xml", "2.3", webXml );

        Element element = findElement( component, "webroots" );
        removeOldElements( element, "root" );

        element = createElement( element, "root" );
        element.addAttribute( "relative", "/" );
        element.addAttribute( "url", getModuleFileUrl( warSrc ) );
    }