<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><link type="text/css" href="../../../../../default_style.css" rel="stylesheet"><link type="text/css" href="../../../../../webtools/wtp.css" rel="stylesheet"><title>test plan: Set up Web Library dependencies</title></head><body><table border="0" cellpadding="2" cellspacing="5" width="100%"><tbody><tr><td align="left" width="60%"><font class="indextop">jst j2ee</font><br><font class="indexsub">test plan: Set up Web Library dependencies</font></td><td width="40%"><img src="../../../../../webtools/images/wtplogosmall.jpg" align="middle" height="129" hspace="50" width="207" alt="WTP Logo" usemap="logomap"><map id="logomap" name="logomap"><area coords="0,0,207,129" href="/webtools/" alt="WTP Home"></map></td></tr></tbody></table><table border="0" cellpadding="2" cellspacing="5" width="100%"><col width="16"><col width="*"><tbody><tr><td colspan="2" align="left" bgcolor="#0080c0" valign="top"><b><font color="#ffffff" face="Arial,Helvetica">Introduction</font></b></td></tr><tr><td align="right" valign="top"> | |
| |
</td><td valign="top"><p>This test plan walks you through the scenario of how to set up web library project jar dependencies in web modules.<br> | |
<br> | |
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. | |
</p></td></tr><tr><td colspan="2" align="left" bgcolor="#0080c0" valign="top"><b><font color="#ffffff" face="Arial,Helvetica">Prerequisites</font></b></td></tr><tr><td align="right" valign="top"> | |
| |
</td><td valign="top"><p>This test plan scenario works on WTP 0.7 M5 or later milestone releases.<br> | |
</p></td></tr><tr><td colspan="2" align="left" bgcolor="#0080c0" valign="top"><b><font color="#ffffff" face="Arial,Helvetica">Steps</font></b></td></tr><tr><td align="right" valign="top"> | |
| |
</td><td valign="top"><p> | |
<ol> | |
<br> | |
<li> Create a Web module within an EAR and create 2 java projects.<br> | |
<br> | |
</li> | |
<li> To navigate to the "Web Libraries" properties page right click on the web module created and select <b>Properties</b>-> <b>J2EE Module Dependencies</b>-> <b>Web Libraries</b> <br> | |
<br> | |
<table cellspacing="10" cellpadding="10"> | |
<tr> | |
<td> | |
<img src="images/weblibdependency.jpg"> | |
</td> | |
</tr> | |
</table> | |
</li> | |
<li> 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 <b>OK</b> or <b>Apply</b><br> | |
<br> | |
<b>Result:</b> The following changes occur on setting the web library dependency on the web module. <br> | |
The .wtpmodules file gets each java module added as dependent module to the web module<br> | |
The .classpath file of the web module gets updated with an entry for the selected java modules. <br> | |
The .project files gets updated with the project dependency.<br> | |
<br> | |
</li> | |
<br> | |
<br> | |
<li> | |
<b>Add External Jar... </b>You could specify a jar which is outside the workspace using this option. | |
The .wtpmodules gets updated with an entry similar to the following | |
<pre> | |
<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"/> | |
</pre> | |
</li> | |
<br> | |
<br> | |
<li> | |
<b>Add Variable... </b>You could specify a jar which relative to a ClassPath Variable. | |
The .wtpmodules gets updated with an entry similar to the following | |
<pre> | |
<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"/> | |
</pre> | |
</li> | |
</ol> | |
</p></td></tr></tbody></table></body></html> |