Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add IntelliJ IDEA DSpace 6 / Services command line debugging info

...

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.

DSpace 6 (Services) and debugging command line

Because I wanted to debug command-line main

Remove: <scope>provided</scope> from servlet-api in many pom.xml files.

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>

 

Add some dependencies to:

dspace-services/src/main/java/org/dspace/services/caching/CachingServiceImpl.java

import javax.servlet.ServletRequest;
import javax.servlet.http.HttpSession;

 

Navigate to dspace-api/src/main/java/org/dspace/app/launcher/ScriptLauncher.java, and click Run --> Edit Configurations...

Image Added

 

And fill in the Configuration of:

Main class: org.dspace.app.launcher.ScriptLauncher

VM options: -Ddspace.dir=/dspace -Ddspace.configuration=/dspace/config/dspace.cfg -Dservice.manager.spring.configs=/dspace/config/spring/api/*.xml

(I was debugging the checksum checker, so I passed the args that would go to /dspace/bin/dspace )

Program arugments: checker

Working directory: /dpsace/config

Environment variables: dspace.dir=/dspace/

Image Added

From then, you can click Run -> Debug "ScriptLauncher", or click the green bug button, and the debugger should start up.

Image Added

 

Tips

If you leave the "run" dialog boxes open at the bottom, you have a quick way to re-run the build and deployment tasks. The maven build can be re-run by clicking the green icon that looks like ">>", and likewise for the ant + tomcat deployment, except you'll have to click "stop" first, and wait for tomcat to shut down.

...