How to setup a WSAG4J client project
This is a step by step guide for new WSAG4J users. It describes the required steps to install the WSAG4J server application and set up an initial WSAG4J client project. Be aware that a WSAG4J client requires an active WSAG4J server in order to work. Here is a quick guide to install the WSAG4J server application used in this tutorial.
WSAG4J client project setup
Download the WSAG4J client distribution
WSAG4J ships with 2 distributions: the WSAG4J server distribution and the WSAG4J client distribution. Download and extract the WSAG4J client distribution.
Eclipse IDE project
This tutorial uses Eclipse as development environment to set up the WSAG4J client project. There are two alternatives to set up the WSAG4J client project: as Java Project or as Maven project. Both of them are described below.
- Start the Eclipse IDE and create a new Java Project. Select File->New->Java Project from the Eclipse menu. This starts the Eclipse New Project Wizard. Type in a name for your project and press Finish.
- Add the WSAG4J configuration files. Create a new folder resources in your Java project. Copy all files from the classes folder of the WSAG4J client distribution to the resources folder. Right click the Java project and select Properties. Select Java Build Path->Libraries. Click Add Class Folder..., then select the resources folder and click OK.
- Add the WSAG4J libraries to the Java project. Right click the Java project and select Properties. Select Java Build Path->Libraries. Select "Add External JARs..." and open the lib folder of the WSAG4J client distribution. Select all jar archives and click OK.
- Ensure that your Eclipse IDE has the Maven plugin m2eclipse installed.
- Start the Eclipse IDE and create a new Maven Project. Select File->New->Project from the menu bar and select Maven->Maven Project. In the Maven Project wizard select create a simple project and click Next. Type in a group id and an artefact id and press Finish.
- Add the WSAG4J Repository to the project POM. Insert the following lines inside the project tag of your project POM:
<name>PACKCS - Archiva Managed Release Repository</name>
- Copy all configuration files from the classes folder of the WSAG4J client distribution into the src/main/resources folder of your Maven project.
This section describes how to install the WSAG4J web application into the Tomcat servlet engine.
- Download the Apache Tomcat and extract it into your home directory.
- Download the WSAG4J server distribution and extract it.
- Copy the wsag4j-agreement-factory-1.0.2.war from your WSAG4J server installation to the webapps folder of your Tomcat installation.
- Start Tomcat by calling the start script from the subfolder named bin of your Tomcat installation.
Opening the URL http://127.0.0.1:8080/wsag4j-agreement-factory-1.0.2 in a Web-Browser. This should display the Welcome Page of the WSAG4J server application.