wiki:BuildInstructions

Building ncWMS from source

Obtaining the ncWMS source code

You can obtain a source distribution in two ways:

  1. Download the source package for the latest official release from  http://sourceforge.net/projects/ncwms/files/ncwms/1.0RC3/ncWMS-1.0RC3-src.zip/download.
  2. Check out the latest code from the Subversion trunk by running svn co https://ncwms.svn.sourceforge.net/svnroot/ncwms/trunk.

Building the source code

ncWMS requires Java version 1.6 or above. There are three methods for building the ncWMS WAR file from the source code. In all cases, the WAR file will appear in the dist directory under the source code root.

Using NetBeans

The source distribution contains nbproject files that allow the source to be imported into  NetBeans as a project. (NetBeans version 7 or above is required for version 1.0RC3. You'll need a version that has the "Java Web and EE" modules - the barebones IDE won't be sufficient.) Open the source distribution in NetBeans as a project then, in the Projects window, right-click on the project root and click "Build".

Using Apache Ant

If you do not have NetBeans you can build the WAR file using Apache Ant version 1.7.1 or above. The source distribution contains all library dependencies except servlet-api.jar (required for compiling the source) and copylibstask.jar (required for assembling the WAR file). If you have Apache Tomcat then you will have a copy of servlet-api.jar file in Tomcat 5.5's common/lib directory or Tomcat 6's lib directory. You can download the copylibstask.jar file from the link at the bottom of this page.

You must compile the source using the following command, which must be run from the root directory of the source code tree (i.e. the directory that contains build.xml).

ant -Dj2ee.platform.classpath=/full/path/to/servlet-api.jar -Dlibs.CopyLibs.classpath=copylibstask.jar

(Note that this also builds all Javadoc.) If you have any problems with the build, check that your JAVA_HOME environment variable is set correctly, even if the correct java binaries are in your PATH.

Using Eclipse

NOTE: These instructions were written for a previous version of ncWMS.

With a little manual setup, ncWMS can also be built using  Eclipse. Thanks very much to Luis Bermudez for these tips:

  1. Get the source code, either by downloading the zip or from the Subversion server (see top of page).
  2. Create a new Java project in Eclipse
  3. Right-click on the project and select Properties
  4. Set the source to the src/ directory of the ncWMS source code (see Figure 1 Download)
  5. Set the output folder to web/WEB-INF/classes (see Figure 1 Download)
  6. Add all the libraries from the WEB-INF/lib directory (see Figure 2 Download)
  7. Also add the servlet-api.jar library from the lib/ directory of your Tomcat installation (see Figure 2 Download)

Attachments