develop on jGuard with Eclipse
it is required to install maven 2 and include it on your path.jGuard sub-directories as Eclipse projects
when you have created your svn repository related to jGuard(https://svn.sourceforge.net/svnroot/jguard/jguard), you need to navigate into the trunk subdirectory. you will find these directories:- jguard
- jguard-core
- jguard-ext
- jguard-ext-java-5
- jguard-jee
- jguard-jee- extras
- jguard-struts-example
- jguard-swing-example
working on trunk and branches
if you work on the trunk and in a specific branch, we recommend you create some working sets : one for the trunk, and one for each branch. each working set will contains all the eclipse projects owned by these trunk/branches. for example, you can create a working set intitled jguard-trunk , and another one intitled jguard-branch_1.0 . in the same way, it is a good practice to prefix the projects in each working set. for example, you can create these eclipse projects like this: for the jguard-trunk working set, you can create the projects:- trunk_jguard
- trunk_jguard-core
- trunk_jguard-ext
- trunk_jguard-ext-java-5
- trunk_jguard-jee
- trunk_jguard-jee-extras
- trunk_jguard-struts-example
- trunk_jguard-swing-example
in the same way, for the jguard-branch_1.0 working set:
- branch_1.0_jguard
- branch_1.0_jguard-core
- branch_1.0_jguard-ext
- branch_1.0_jguard-ext-java-5
- branch_1.0_jguard-jee
- branch_1.0_jguard-jee-extras
- branch_1.0_jguard-struts-example
- branch_1.0_jguard-swing-example
declare the M2_REPO variable in eclipse
your maven 2 local repository location should be referenced with the M2_REPO variable. to declare this variable, go to window > preferences > java > Build Path > Classpath variables > new
build paths for projects
- configuring source folders in the build path
configure libraries folder in the build path
to add a library, in the libraries folder, you have to click on add variable > select M2_REPO > extends > select the jar to add . it permits to use the same libraries officially released with maven 2, and be independant of the location of the local repository.
to be shipped in a webapp, each library have to declare some facets :
right-click on the project > properties > project facets > add/remove Projects facets :
add the java facet 1.4 (1.5 for jguard-ext-java-5), and the utility facet.
build paths for webapp projects
webapp sources need many libraries to be compiled. most of them will be shipped in the webapp Archive (i.e war), but someone like servlet.jar/j2ee.jar or junit.jar are already present in the application server, and must not be shipped in the war file. in the webapp example, junit.jar and servlet.jar will be used for compilation (jars present in the M2_REPO will be used) but not shipped in the war archive, and other libraries will be declared as j2ee dependencies.
other projects like jguard-core or jguard-ext have also to be declared as j2ee module dependencies.
you can only do it if you've added to these projects the java and utility module facets described above.
execute the webapp on an application server from Eclipse
you have to register your application server in the servers view. add your webapp project to the server : right-click on the server registered in the servers view, and select add/remove project. right click on your project, and select *Run As > Run on server *. to launch the application server in debug mode, right click on your project, and select *Debug As > Debug on server *.
Version 1.52 last modified by Charles Gay on 11/02/2007 at 13:46
Comments: 0