Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Formatting fixes, minor updates

...

Note
  • These instructions assume you are using DSpace 1.5.x (or higher) in the NetBeans IDE.
  • DSpace 1.4.x and previous are not covered.

Table of Contents:

Table of Contents
outlinetrue
stylenone

Installing NetBeans

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

...

Now simply run the downloaded installer.Note: If you are running on

Info

Wiki Markup
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 they require that you register first. Registration is also free, but requires a valid email address)

...

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 7 or higher works best with Maven 2.02.81. 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 bundled 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 bottomIn the middle of this page, you may 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 ~/.m2/
      • On Windows, it should be located at C:\Documents and Settings\username\.m2 (Windows XP) or C:\Users\username\.m2 (Windows 7)
    • All the other Maven settings should be fine as their defaults. Press "OK" to save your changes.

...

  • Under the 'Team' menu, go to 'Subversion ' and then 'Checkout'. Enter the URL for the DSpace Subversion repository: https://scm.dspace.org/svn/repo/dspace, and click on the next button.
  • Next to 'Repository Folder(s)', click on 'Browse', and browse to the version of DSpace you wish to checkout. A few hints:
    • Stable, tested versions of DSpace are available under tags (e.g. tags/dspace-1_57_21)
    • Latest Bug Fixes (though slightly less stable) are available under branches (e.g. branches/dspace-1_57_x)
    • Unstable code is available on trunk. It is not recommended that you checkout trunk unless you know what you are doing!
  • Choose a local folder to checkout to (or leave the default entry), and leave the 'Scan for NetBeans projects after Checkout' option selected, and click on 'Finish'.
  • When NetBeans completes the checkout, it will pop-up a dialog telling you that it found projects during the checkout. Choose 'Open Project' from the dialog. Select all the projects that you wish to open (hold down ctrl to select multiple), and click the OK button.

...

Build DSpace from NetBeans

Wiki Markup
Remember, you build DSpace from within the _dspace_ sub-folder (e.g.
<dspace-src>
 {{\[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:

  • Right click in your "Projects" window
  • Wiki Markup
    Select "Open Project", and browse to
    the <dspace-src>
     the {{\[dspace-src\]/dspace/}} directory.  You should see the Project Name (on the right) specified as "DSpace Assembly and Configuration".
  • Click the "Open Project" button.

...

  1. Right-click on the "DSpace Assembly and Configuration" project
  2. Wiki Markup
    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>
     the {{\[dspace-src\]/dspace/target/dspace-
    1.5.x
    \[version\]-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:

...

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

Run DSpace from NetBeans with Tomcat

...

  • Select the project for the Web Application you wish to run through Tomcat (e.g. "DSpace XML-UI (Manakin) :: Web Application Resources (war)" for the XMLUI). This project *must* be a "(war)" based project, as Tomcat only runs WAR files.
  • Right click on your selected project and click "Properties"
  • From the Properties window, select the "Run" category.
    • From these Run settings, you'll want to specify the Server which this application should run on. Select your newly configured Tomcat server.
    • Also, specify a "Context Path". This should be the ending path on the URL. For example, specifying "/xmlui" will mean your web application will be available from "http://localhost:8080/xmlui"
  • Now, click over to the "Actions" category on the left.
    • You'll see a list of Actions on the right. Click on the "Run Project" action (as this is the one used to run your web application).
    • In that Action's "Set Properties" section, add a property to point it to your DSpace installation's configuration file (dspace.cfg). The following is an example on Windows, assuming that you've installed DSpace to "C:/Program Files/dspace-1_57/":
      • dspace.config="C:/Program Files/dspace-1_57/config/dspace.cfg" (make sure to include this entire line)
  • Finally, click "OK" at the bottom to save all your new project settings.

...

  • Select the project for the Web Application you wish to run through Tomcat (e.g. "DSpace XML-UI (Manakin) :: Web Application Resources (war)" for the XMLUI). This project *must* be a "(war)" based project.
  • Right click on your selected project and click "Properties"
  • From the Properties window, select the "Actions" category on the left.
    • You'll see a list of Actions on the right. Click on the "Debug Project" action (as this is the one used to debug your web application).
    • In that Action's "Set Properties" section, add a property to point it to your DSpace installation's configuration file (dspace.cfg). Make sure to keep all existing properties in tact, and just add your new property. The following is an example on Windows, assuming that you've installed DSpace to "C:/Program Files/dspace-1_57/":
      • dspace.config="C:/Program Files/dspace-1_57/config/dspace.cfg" (make sure to include this entire line)
  • Finally, click "OK" at the bottom to save all your new project settings.

...