Search code examples
javamavenantbuilddspace

DSpace 5 "disappears" after ant update


I am a former UX-only person attempting to make changes to our DSpace 5 config and web interface files. (We're using the JSPUI version.)

At one time I was able to make changes, rebuild, and redeploy with no problems. At some point, the process stopped working and I'm not sure what I've done or how to fix it. Here's what's happening:

  1. I make changes in (what I think is) the correct directory for them. (/dspace-5.2-src-release/dspace-jspui for the web interface files, /dspace-5.2-src-release/dspace for the configs)
  2. I run mvn package in (what I think is) the correct location (/dspace-5.2-src-release/dspace). The build completes successfully.
  3. I run ant update in (what I think is) the correct location (/dspace-5.2-src-release/dspace/target/dspace-installer). There is a flood of error messages to the effect of "directory wasn't copied, access was denied". But at the end the update says it completes successfully.
  4. I check the website and am greeted with a blank white page.
  5. I check Tomcat and there is no longer any entry for a jspui directory.

Any ideas on what's happening and how to fix it?

E: I don't know if it's related, but batch upload no longer works either, through the web UI or the command-line directory import tool, when the site is up and running. The upload completes successfully but when I click on the collection to view items I get an internal server error.


Solution

  • First of all, you're running maven in the wrong directory, it needs to be [dspace-src] not [dspace-src]/dspace.

    What you're using (running maven in [dspace-src]/dspace) is the "quick build" option. It works only if all your changes are exclusively under [dspace-src]/dspace. If you want to use the quick build option but also wish to make changes to a file that normally resides in eg [dspace-src]/dspace-jspui, you will need to copy that file over into the corresponding directory under [dspace-src]/dspace/modules/jspui. The copy in the module will then "overlay" (ie replace) the file from the official DSpace source tree. If you're changing files directly in eg [dspace-src]/dspace-jspui, that's fine too (that's how I make my own customisations), but then you will need to use the "full build" option, ie, running maven in [dspace-src].

    Official documentation: Advanced Customisation page in the DSpace docs.

    Secondly, I suspect you're running ant as the wrong user, which is why you're getting the permissions issues. The user that ant runs under must have write access to the DSpace installation directory. The DSpace installation directory should (pretty much must) be owned by the user that Tomcat runs under. I personally run ant as the root user, then chown -R my DSpace installation directory to the tomcat user, then restart Tomcat.