Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

Now simply run the downloaded installer.

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

Info

Wiki Markup

Git Plugin / Support

As long as you are running NetBeans 7.1 or above, Git support comes pre-installed in NetBeans.

...

Note
titleUsing a Local Subversion Repository instead?

If your institution plans to instead use a local Subversion repository for your local development, you can do so (you will just need to download the DSpace Source Code and import into your local subversion repository).
Subversion support is already included in NetBeans. However, it requires that the command line client is installed and available on your local machine.

  • For most Linux distributions, you should be able to just install the Subversion client available in your distribution's repositories.
  • For Windows, there is now a 'Bundled Subversion Client for Windows' Plugin which you can install from within NetBeans
    • Go to Tools -> Plugins to install the plugin.
  • For Windows/RedHat/Solaris, CollabNet also offers free Subversion downloads that are specifically tested with NetBeans: http://www.collab.net/downloads/netbeans/Image Removed (Free to download, but they require that you register first. Registration is also free, but requires a valid email address)

...

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

...

  • Under the '_Team_' menu, go to '_Git_' -> '_Clone_'. (In Git terminology, "clone" just means you are downloading an exact copy of the remote code repository to your local machine.) Enter the URL for the DSpace Repository in GitHub which you wish to work with (e.g. [https://github.com/DSpace/DSpace.git] OR if you have your own fork: https://github.com/\[your-username\]/DSpace.git), optionally enter in a GitHub username/password, and click on the "Next" button.
      unmigrated-wiki-markup
    • _*IMPORTANT NOTE:*_ If you plan to do a larger amount of DSpace development or local changes, you may wish to first ["fork"|http the DSpace GitHub Repository (https://help.github.com/fork-a-repo/] the DSpace GitHub Repository (https://github.com/DSpace/DSpace) to your own GitHub account. This will create your own copy of the DSpace source code under your GitHub account /DSpace/DSpace) to your own GitHub account. This will create your own copy of the DSpace source code under your GitHub account (e.g. https://github.com/\[your-username\]/DSpace). You can then checkout your own forked repository to work from and commit local changes to (push changes to). For more information, see the GitHub help page on ["Forking a Repo"|http://help.github.com/fork-a-repo/].
  • Next, select the "Remote Branch" you wish to develop on. A few hints:
    • Branches named "dspace-#_#_x" (e.g. dspace-1_8_x) are Bug Fix / Maintenance branches. So, the latest code in that bug-fix or maintenance release will be available on that branch. This code tends to be more stable overall. As such, we recommend most developers use the appropriate Bug Fix / Maintenance branch for their local development.
    • The branch named master is roughly equivalent to the old SVN Trunk. As such, it may not be as stable, but it includes the latest & greatest code which is being prepared for the next major release. Unless you know what you are doing, we do NOT recommend running this code in Production. It is essentially "unsupported" until it is officially released.
    • If you wish to work from a "tagged" (official release) version of DSpace (e.g. 1.8.2), you can download those releases as Tarballs/Zips from: https://github.com/DSpace/DSpace/tagsImage Removed You could then use that Tarball/Zip to import it into your own Git/GitHub or SVN repository as you see fit.
  • Next, choose a local parent folder to use and the "Clone Name" (actual folder name for the source code), and leave the 'Scan for NetBeans projects after Clone' option selected, and click on 'Finish'. (All other options you should be able to leave as their default values.)
  • When NetBeans completes the clone, it will pop-up a dialog telling you that it found a number of DSpace projects (Maven projects) during the checkout. Choose 'Open Project' from the dialog. Select all the projects (and/or subprojects) that you wish to open (hold down ctrl or shift to select multiple), and click the "Open" button. (Don't worry you can always Open or Close projects later if you notice you opened up too few or too many)

...

  1. Fork your own Repo to store your local changes: As recommended above, you really should think about forking your own copy of the DSpace GitHub repository. As GitHub describes in their "Fork a Repo" guide, forking lets you create your own personal copy of the codebase. It not only provides you a place to put your local customizations. It also provides an easier way to contribute your work back to the DSpace community (via a GitHub Pull Request).
  2. For easier Fetch/Merge, setup an "upstream" repository location: This is only really relevant if you have your own personal "fork" (see #1). If you have forked the DSpace GitHub repository, then you may want to setup an "upstream" remote that points at the central DSpace GitHub repository. This is described in more detail in the GitHub "Fork a Repo" guide. Perform the following:
      unmigrated-wiki-markup
    • On the command-line, change directory to your local machines' cloned DSpace git repository, which is also your DSpace source directory (e.g. {{cd \ [dspace-src\]}})
    • Run the following 'git' command from that directory:
      Code Block
      git remote add upstream git://github.com/DSpace/DSpace.git
      (Technically you can name it something other than "upstream". But, "upstream" is just the GitHub recommended naming convention).
    • For more information about how this comes in handy, see the section below on "#Fetch & Merge Example via NetBeans".

...

  1. Fetch changes from DSpace Main GitHub: You fetch (and later merge) changes that have occurred in the central DSpace GitHub Repository:
    • From NetBeans: Right-click on the "DSpace Parent Project" (root project) and then select: Git -> Remote -> Fetch. This will pop up a window that will allow you to easily select the "upstream" configured repository to fetch the latest changes from, and allow you to choose the "master" branch to apply them to. Once you click "Finish", a new "upstream/master" branch will be created locally with the latest changes to be merged.unmigrated-wiki-markup
    • _From Command-line_ in your DSpace source directory (e.g. {{cd \ [dspace-src\]}}): {{git fetch upstream}}
  2. Merge changes into your Local Git Repo: Remember, "fetching" changes just brings them into your local-machine's copy of the Git repository. You'll then need to merge those changes with yours and push the changes back to your personal public GitHub repository.
    • From NetBeans: Right-click on the "DSpace Parent Project" (root project) and then select: Git -> Merge Revision. This will pop up a window to let you select which "branch" to merge into your currently checked out code. If press "Select", you'll see a new branch called "upstream/master" under "Branches -> Remote". Selecting that branch will merge the latest code from "upstream/master" into whatever branch you currently are working with (e.g. "master").
    • From Command-line in that same directory: git merge upstream/master
  3. Quick Status of Local Git Repo: If you want to see what happened, you can look at the "Status" information:
    • From NetBeans: Right-click on the "DSpace Parent Project" (root project) and then select: Git -> Show History. Click the "Search" button (without entering any search info). It will bring back results that will show you where the HEAD pointer is (latest commit in your local machine's git repo) versus where the 'origin/master' is (latest commit in your personal GitHub repo).
    • From Command-line in that same directory: git status (will tell you how many "commits ahead" of 'origin/master' you now are)
  4. Push Merged Code up to your Personal GitHub Repo: Finally, assuming all went well, you can push your changes back up to GitHub into your public personal repository:
    • From NetBeans: Right-click on the "DSpace Parent Project" (root project) and then select: Git -> Remote -> Push. This will pop up a window that will allow you to select the "origin" repository (your personal fork in GitHub), and allow you to choose the "master" branch to push to.
    • From Command-line in that same directory: git push origin master

...

*Quick Build:* Running {{mvn package}} from the {{\[dspace-src\]/dspace/}} directory (Or run "Build" on the "DSpace Assembly and Configuration" project in NetBeans). This option performs a "quick build". It does not recompile/rebuild all DSpace modules. All it does is rebuild and re-apply any Maven WAR Overlays to the previously compiled source code. In other words, the ONLY code that will be recompiled/rebuilt is code that exists in {{\[dspace-src\]/dspace/modules/*}} (the Maven WAR Overlay directories)
Note
titleTwo Ways to Build DSpace

As of DSpace 1.8, there are now two options to building DSpace Source Code as detailed in the Advanced Customisation Documentation. They are as follows:

unmigrated-wiki-markup

  • *Full Build:* Running {{mvn package}} from the root {{\[dspace-src\]}} directory (Or run "Build" on the "DSpace Parent Project" in NetBeans). This option will rebuild all DSpace modules from their Java Source code, then apply any Maven WAR Overlays. In other words, all subdirectories of {{\[dspace-src\]}} are recompiled/rebuilt.
Wiki Markup

Wiki MarkupAs described in the note above, as of DSpace 1.8, there are two options to build DSpace. Traditionally (before 1.8), you could only build DSpace from 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 proper project opened (NetBeans may not have opened it by default), then open it manually:

  • Right click in your "Projects" windowunmigrated-wiki-markup
  • Select "Open Project", and browse to either the {{\[dspace-src\]}} OR {{\[dspace-src\]/dspace/}} directory (based on the build option you wish to use). You should see the Project Name (on the right) specified as either "DSpace Parent Project" or "DSpace Assembly and Configuration", respectively.
  • Click the "Open Project" button.

...

  1. Right-click on the projectunmigrated-wiki-markup
  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-\[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 (!) 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: (You need to create a database and a database owner first.)
    • Go to your start browser, open pgAdmin (Assuming you install PostGreSQL)
    • Connect to PostGreSQL 9.0
    • Right click login roles, select new login role
    • Type dspace for the following fields: Role name/ password/ password again
    • Click Ok
    • Right click database, select new database
    • Type dspace in the following field: Name. Select dspace from dspace owner field
    • Click Ok
    • Return to project folder in Netbeans
    • Click over to the "Files" tab in the left hand windowunmigrated-wiki-markup
    • Browse under the "DSpace Assembly and Configuration" project. You are looking for the {{target/dspace-\[version\]-build.dir/build.xml}} Ant configuration file.
    • Right click on the build.xml file and select "Run Target" => "fresh_install"
        unmigrated-wiki-markup
      • The above command will perform a fresh install of DSpace based on the settings specified in your {{target/dspace-\[version\]-build.dir/config/dspace.cfg}} file.
      • The default installation url is C:\dspace.
    • After installation, open cmd
    • Navigate to your installation folder\bin. Default is C:\dspace. Example command: cd C:\dspace\bin
    • Type the following command: dspace.bat create-administrator
    • Key in the information specified by the command prompt instructions

...