Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. These instructions assume you are using DSpace 1.5.x in the NetBeans IDE.
  2. DSpace 1.4.x and previous are not covered.

Installing NetBeans

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

...

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.

...

  • For Windows/RedHat/Solaris, CollabNet also offers free Subversion downloads that are specifically tested with NetBeans: http://www.collab.net/downloads/netbeans/ (Free to download, but require that you register first. Registration is also free, but requires a valid email address)

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 works best with Maven 2.0.8. You should check the latest pre-requisites if you are using a later version of DSpace)

  • First, install Maven:
    • For most Linux distributions, you should be able to just install the Maven client available in your distribution's repositories.
    • For all other operating systems, you can install the latest version from the Apache Maven site.
  • Configure Netbeans to use your external Maven:
    • Go to the "Tools" menu, and select "Options" (on OS/X, this is "NetBeans" -> "Preferences")
    • Select the "Miscellaneous" section.
    • Select the "Maven" tab.
    • Directly under the "External Maven Home" field, you'll see a line that says "Using Default Maven Version:____". It's possible that Netbeans will already see your external version of Maven (if it's in your PATH). However, if it says that it is using the "embedded maven", then you'll want to fill out the "_External Maven Home" field with the location of your external installation of Maven.
    • Down near the bottom, you also need to fill out the location of your "Local Repository". This should be the location of the ".m2" directory under your user's home directory.
      • On Linux and OS/X, it should be located at
        Code Block
        ~/.m2/
      • On Windows, it should be located at
        Code Block
        C:\Documents and Settings\username\.m2
        (Windows XP) or
        Code Block
        C:\Users\username\.m2
        (Windows 7)
    • All the other Maven settings should be fine as their defaults. Press "OK" to save your changes.

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.

...

  • Right click on the project
  • Select "Show and Resolve Problems..." (near bottom of pop-up menu)
  • Click on "Download Libraries" (assuming the problem is that "Some dependency artifacts are not in the local repository").
    NetBeans should then use Maven to find all the DSpace dependencies and download them to your local Maven repository (in your user's
    Code Block
    ~/.m2/
    folder)

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).

...

  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
    Code Block
    ant fresh_install
    command as follows:
    • Click over to the "Files" tab in the left hand window
    • Browse under the "DSpace Assembly and Configuration" project. You are looking for the
      Code Block
      target/dspace-[version]-build.dir/build.xml
      Ant configuration file.
    • Right click on the
      Code Block
      build.xml
      file and select "Run Target" => "fresh_install"
      • The above command will perform a fresh install of DSpace based on the settings specified in your
        Code Block
        target/dspace-[version]-build.dir/config/dspace.cfg
        file.
    • Finally, return to the normal installation procedure in the DSpace System Documentation for the commands to setup an initial DSpace Administrator, etc. from your newly created
      Code Block
      [dspace]
      installation directory.

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.

  • First, you'll need to install the "Tomcat" plugin for NetBeans, if it isn't already installed.
    • Go to the "Tools" menu and select "Plugins".
    • Select the "Available Plugins" tab. This should list an entry for "Tomcat"
    • Check the box next to it, and click on 'install'.
    • Restart NetBeans
  • You'll now want to tell NetBeans where your Tomcat installation is located.
    • Go to the "Tools" menu and select "Servers".
    • Click the "Add Server.." button to add a new server
    • Select the type of Server (e.g. Tomcat 6.0) and click "Next >"
    • NetBeans will ask you for the "Catalina Home" location of this Tomcat Server. This is the location where Tomcat is installed (e.g. On Windows it may be "C:\Program Files\Apache Software Foundation\Tomcat-6.0"). You'll also need to give NetBeans your credentials for the "manager" role in Tomcat.
  • After configuring your Tomcat 6.0 server, you may want to reconfigure a few default settings.
    • Go to the "Tools" menu and select "Servers".
    • Select your "Tomcat 6.0" server.
    • On the "Connection" tab, you may wish to enable the HTTP Monitor option
      • This will start up HTTP Monitoring (in a new tab) in NetBeans, whenever you start this server. HTTP Monitoring may be useful to developers who wish to view all HTTP requests/responses that occur during their development process.

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.

...

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:

...