Note:

Table of Contents:

Installing NetBeans

NetBeans 6.8 (or latest version) is recommended for both performance and features. Download it from http://www.netbeans.org/.

Choose either the 'Java SE' or 'Java' version. The 'Java' version has more features (such as editing JSPs), and although the GlassFish / Tomcat runtimes will be downloaded, you don't have to install them. If you choose the 'Java SE' version, you can always install those extra features later (as plugins).

Now simply run the downloaded installer.

Note: If you are running on Linux/Unix, you will need to make the downloaded script executable (e.g. chmod +x netbeans-version-full-linux.sh).

Subversion Client

Subversion support is already included in NetBeans. However, it requires that the command line client is installed and available on your local machine.

Install Maven Support

NOTE: For NetBeans 6.7 and above, Maven support comes out of the box. So, you do not need to install any Plugins!

From the "Tools" menu, select the "Plugins" entry. This will open the Plugin Manager - from here, select the "Available Plugins" tab. This should list an entry for "Maven" - check the box next to it, and click on 'install'.

Integrate an External Installation of Maven

Although not required, it's recommended to install an external version of Apache Maven. This will ensure that you are using the version of Maven which DSpace supports. (DSpace 1.5.x or higher works best with Maven 2.0.8. You should check the latest pre-requisites if you are using a later version of DSpace)

Checkout DSpace from Subversion

NetBeans makes the checkout and configure process easy, as it does nearly everything for you.

After the checkout has completed, you'll notice NetBeans considers each DSpace Maven "module" to be a separate project. So, you'll see separate projects for "DSpace XML-UI" and "DSpace JSP-UI", even though these are all checked out from the same source code.

Build DSpace from NetBeans

Remember, you build DSpace from within the dspace sub-folder (e.g. <dspace-src>/dspace). In NetBeans, this project is named "DSpace Assembly and Configuration", based on the name specified in its Maven configuration file (pom.xml).

If you do not see the "DSpace Assembly and Configuration" project opened (NetBeans may not have opened it by default), then open it manually:

Once that project is opened, you can build DSpace by doing the following:

  1. Right-click on the "DSpace Assembly and Configuration" project
  2. Select the "Build" option (alternatively you may select "Clean & Build" to first clean out previous builds).
    You should be able to watch the status in the "Output" window at the bottom of NetBeans. The end result is that DSpace is built into the <dspace-src>/dspace/target/dspace-1.5.x-build.dir/ directory (you can verify this from the "Files" window in NetBeans, if you wish).

After building DSpace for the first time, you may still see red exclamation point icons (warning) next to some projects. In most cases, this is caused by NetBeans being unable to locate some of the DSpace third-party dependencies on your local file system. To fix this problem, do the follow for each project which has a red icon next to it:

Install DSpace normally

After building DSpace, we need to use Apache Ant to install it. Unfortunately, this is an area where NetBeans is not very helpful (as we built DSpace using Maven, it will continue to assume all of our projects are Maven-based projects).

You have two options here:

  1. The easiest way to install DSpace may be to just follow the normal installation procedure in the DSpace System Documentation. NetBeans doesn't seem to have an efficient way to perform this installation, so it's easiest to just do it from the command line, as normal.
  2. Alternatively, you can use NetBeans to run the ant fresh_install command as follows:

Run DSpace from NetBeans with Tomcat

Once you have DSpace installed, you can run any DSpace web application (XMLUI, JSPUI, SWORD, LNI, etc.) from NetBeans after you integrate NetBeans with Apache Tomcat.

Integrate an External Installation of Tomcat

If you have Tomcat installed separately from NetBeans, you'll need to tell NetBeans where it's located.

Run DSpace WebApp using Tomcat Integration

Once NetBeans knows about Tomcat, you can run your DSpace webapps through this Tomcat integration and even perform debugging of your DSpace web application. To do this, we'll need to perform some basic configuration of the web application project in NetBeans.

Now, test it out!

Right click on the project, and select "Run". This should re-build the project, start-up Tomcat, and open up your application in your default web browser.

BONUS: If you haven't already noticed, NetBeans will auto-rebuild your project in real-time while Tomcat is running. This means, if you want to edit a CSS or XSLT (for the XMLUI), you can edit it and just refresh your web browser. Your changes should show up in the browser almost immediately. (That being said, there are times when you will still have to restart Tomcat in NetBeans – usually after you haven't restarted it in a long time, or after an update to Java source code)

Debug DSpace WebApp using Tomcat Integration

Debugging a DSpace web application involves mostly the same setup as running it. The main difference here is that you need to configure the "Debug Project" settings (rather than the "Run Project" settings). So, similar to above, do the following:

Now, we'll start our web application in Debug-mode. (Make sure to stop Tomcat first, if it is currently running)