Versions Compared

Key

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

...

...

  • Version: 24th August 2009

...

Table of Contents:

Table of Contents
outlinetrue
stylenone

Installing IDEA

This guide covers version 8.3 of IDEA, which you can get from here: http://www.jetbrains.com/idea/. Instructions for installing & running can be found on the website and in the readme file included with the download.

...

Note: If you haven't already defined a JDK, you may not be able to do so at this point, despite being given the option. Instead, create the project without a JDK, then later open the Settings dialog, then go

...

Project

...

Settings

...

->

...

JDKs

...

and add your JDK here

Building and installing DSpace for the first time

...

After this completes:

  • in the Code Blockdspace directory navigate to Code Blocktarget/dspace-SNAPSHOT-<version>.dir/ (the version may vary depending on which part of the svn tree you are using) and edit the Code Blockconfig/dspace.cfg file according to your local requirements (this is the file that will be deployed into your
    Code Block
    [dspace]
    <dspace> directory).
  • make sure you have sufficient permissions on your
    Code Block
    [dspace]
    <dspace> directory and that the correct database exists, etc etc. This is all covered in the install docs, but this differs in one important respect: your user will need to have write permissions on the
    Code Block
    [dspace]
    <dspace> directory. This is because when you run the ant tasks from IDEA they will run with your permissions, and Code Blockant update will fail if you can't write to
    Code Block
    [dspace]
    <dspace>.
  • run Code Blockant fresh_install from this directory. You can do this in IDEA by right clicking Code Blockbuild.xml, and selecting Code BlockAdd as Ant Build File. When the build file dialog opens, select Code Blockfresh_install and hit the run button at the top of the panel.

...

  • For the "project file", you want Code Block[dspace-src]<dspace-src>/dspace/pom.xml.
  • Under "goals", input "clean package"
  • in profiles, put either "postgres" or "oracle", depending on your setup.
  • In the "before launch" section, uncheck "make".

...

  • Check "override" for the Maven Home Directory option, and enter the path to your maven install directory (e.g. Code Block/usr/share/maven-bin-2.0)
  • If necessary, check "override" for the Maven User Settings Directory option and enter the path to your settings file (something like Code Block~/.m2/settings.xml)

Runner Tab

  • put the path to your "live" config in the properties section at the bottom (the property key is " Code Blockdspace.'''config'''", and the value is the absolute path to your Code Blockdspace.cfg). The Code Blockant fresh_install task from the previous section should have pushed this file into your
    Code Block
    [dspace]
    <dspace> directory.
  • check the "skip tests" box (advisable)

Once you have this configured, you should run it, because the previous build will have the incorrect

...

dspace.cfg

...

built into it. You can do this using the quick launch from the IDEA tool bar: in the centre of the toolbar at the top is a pull-down menu which contains all your pre-configured run tasks. Select the one you have named "mvn clean package", and hit the green arrow to the right of it. You should see maven building your project in a window at the bottom of IDEA, and the content will be similar to when you ran it from the command line earlier.

...

The next step in getting fully integrated with this IDE is to set it up with ant and tomcat. First, set up ant by clicking the "Ant build" icon on the right. If you used Ant to build DSpace above, then your previous configuration will remain. Otherwise, add a new one by clicking the "+" icon. Here, you need to select the

...

build.xml

...

file from

...

<dspace-src>/dspace/target/dspace-SNAPSHOT.dir

...

. Now, in either case, right click on the top-level of the tree and select "properties" and click "add". In the boxes provided, enter "config" and the path to your live

...

dspace.cfg

...

. Click "OK".

For tomcat integration, I chose to download and install tomcat 6 in

...

/opt

...

to keep it separate from the 5.5 release that I had previously installed with my package manager. There are a few reasons for this, but mostly it's because we need to assign pretty weak privileges to the tomcat directory because we will be deploying the webapp as a normal user (run something along the lines of

...

chmod

...

-R

...

jim:tomcat

...

/opt/apache-tomcat-6.0.14

...

;

...

chmod

...

-R

...

g+rwx

...

/opt/apache-tomcat-6.0.14

...

as root).

Once you have ant and tomcat ready, you can create a new build configuration for these two. Go to "run" -> "edit configurations", click the "+" and select "tomcat server" -> "local".

...

*Select the web facets previously detected to deploy: select the facet name (e.g.

...

jspui

...

), then check the box "Deploy Web Facet", and enter the path you would like it to appear at in the "Application context" box. These paths are absolute, so if you say "/dspace", it will deploy it to

...

;please also note that you must not include the trailing / in the deployment path.Note: there may be other web facets available, such as

...

dspace-jspui-webapp

...

; these can be deployed but are not connected to the dependency libraries so unless you have tomcat set up specifically to use shared dependencies you will get tomcat errors on trying to load these pages; always use the simple named facet (e.g.

...

jspui

...

) to deploy.

  • You will not be able to deploy any applications which are listed as "Web (dspace-parent)"; this is ok, you just need to deploy the others.
  • When you are finished click "OK"
  • N.B. This stage has recently changed. You used to deploy facets such as Code Blockdspace-jspui-webapp, but you now deploy the facets called just Code Blockjspui etc.

Once you have this set up, you can deploy DSpace, by selecting the tomcat deployment from the menu bar, and hitting the green play button next to it. Hit the play button on the opened dialog, and IDEA will deploy the applications at the context paths specified in this section.

...