jst j2ee
test plan: Set up Web Library dependencies
WTP LogoWTP Home
Introduction
 

This test plan walks you through the scenario of how to set up web library project jar dependencies in web modules.

Web Library java projects are basically java projects that are used as utility projects by the web modules after the dependency is added. The web library java jar dependencies can be set on standalone web modules and web modules belonging to an EAR.

Prerequisites
 

This test plan scenario works on WTP 0.7 M5 or later milestone releases.

Steps
 


  1. Create a Web module within an EAR and create 2 java projects.

  2. To navigate to the "Web Libraries" properties page right click on the web module created and select Properties-> J2EE Module Dependencies-> Web Libraries

  3. You will notice that the java projects created in step 1 are available to be setup as a web library project dependency. Select both the the java projects and click OK or Apply

    Result: The following changes occur on setting the web library dependency on the web module.
    The .wtpmodules file gets each java module added as dependent module to the web module
    The .classpath file of the web module gets updated with an entry for the selected java modules.
    The .project files gets updated with the project dependency.



  4. Add External Jar... You could specify a jar which is outside the workspace using this option. The .wtpmodules gets updated with an entry similar to the following
            <dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/C:/Foo/Foo.jar>">
                <dependency-type>uses</dependency-type>
            </dependent-module>
    
    
            A classpath entry will be added in  the .classpath similar to the following
    
    		<classpathentry exported="true" kind="lib" path="C:/Foo/Foo.jar"/>       
            


  5. Add Variable... You could specify a jar which relative to a ClassPath Variable. The .wtpmodules gets updated with an entry similar to the following
            <dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/var/JUNIT_HOME/junit.jar">
                <dependency-type>uses</dependency-type>
            </dependent-module>
    
    
            A classpath entry will be added in  the .classpath similar to the following
    		<classpathentry  kind="var" path="JUNIT_HOME/junit.jar"/>