Child pages
  • Extracting from SVN components into Eclipse Projects
Skip to end of metadata
Go to start of metadata

Source code checkout with Eclipse

  1. Use the SVN plugin for Eclipse (get it here: http://subclipse.tigris.org ).
  2. Open the view: SVN Repository, and add the URL location:

    https://svn.apache.org/repos/asf/incubator/uima/uimaj/trunk

    Note: the website is under .../incubator/uima/site

    Note: for readonly access, you can use http: instead of https:

  3. Expand this to see the projects. Select the one(s) you want, and right-click, and say "checkout". You can check out as many as you want at one time.
  4. Choose "Checkout as a project in the workspace"

This will create an Eclipse simple project.

In addition to the above URL, there are additional projects in Apache UIMA in the "sandbox". You can check those projects out into the same (or different - it's up to you) workspace. The sandbox projects are located in

http://svn.apache.org/repos/asf/incubator/uima/sandbox/trunk

Converting into Java projects with Maven

First be sure you've told Eclipse about Maven. After installing Maven, open a command window and say
mvn -Declipse.workspace=<eclipse workspace dir> eclipse:add-maven-repo
This you only need to do once (per Eclipse workspace you're using) - it adds a maven repository to your machine (On Windows, under documents & settings / .m2 / repository), and sets up an Eclipse Java Build Path variable to reference it.

To convert this to a Java project with the right class path dependencies (which are computed from the maven pom):

  • open a commmand line window,
  • cd to the project directory, and
  • run the command "mvn eclipse:eclipse".

Do this for Java projects, including the eclipse plugins. It's not needed for the docbook / website projects.

Manually converting into Java projects

  • Alternatively, you can tell the checkout UI to use the Eclipse new project wizard. If you do this, you have to do many things manually:
    In that wizard, which runs repeatedly for each project, specify you want to create
    • a Java project for the Java projects,
    • a plugin project for the uimaj-ep-xxxx projects, and
    • a "simple" project for the uima-docbooks, uimaj, and uimaj-distr.

      Also, for Java projects, make the project depend on the proper other projects (look in the pom for this info), and set up the output folders to be stored in /target (not /bin).

Quickstart Guide for Eclipse:

Follow these steps for the first setup. It will create a working environment without a sophisticated configuration.

Check your Maven installation

Maven needs to be setup properly! Unfortunately the documentation is pretty weak and not consistent here.
In order to use Maven with UIMA you will need to install the activator.jar file from Sun as well (http://java.sun.com/products/javabeans/glasgow/jaf.html). Note for IBMers: contact the UIMA Team before obtaining this. After unpacking the archive, you can execute the following command (change "/path/to/file" to match your activator.jar location):

mvn install:install-file -DgroupId=javax.activation -DartifactId=activation \
-Dversion=1.0.2 -Dpackaging=jar -Dfile=/path/to/file

(Note: even if the activation jar has a higher version, refer to version 1.0.2!!!)
Setting the M2_HOME var and adding mvn to the path can be done in a script in unix or mac. The snippet of script to do this might look like this:

#!/bin/bash
# filename and location: ˜/.bash_login
export M2_HOME=/usr/local/maven
export PATH=${M2_HOME}/bin:$PATH

On Windows, right click on "My Computer" select "Properties". Change to the "Advanced" tab and click on "Environment Variables". Create a new variable called M2_HOME for the Maven home directory and add the following entry to the end of the PATH variable:

;%M2_HOME%\bin
    • open a console and change to the uimaj project in your eclipse workspace
    • verify your the successful installation of Maven by printing its version:
      prompt$ mvn --version
      Maven version: 2.0.4
      
    • execute "mvn install eclipse:eclipse" in the console
      The final output should look similar to that:
      ...
      [INFO] ------------------------------------------------------------------------
      [INFO] Reactor Summary:
      [INFO] ------------------------------------------------------------------------
      [INFO] Apache UIMA Java SDK .................................. SUCCESS [4.410s]
      [INFO] Apache UIMA Utility Classes For JUnit Tests ........... SUCCESS [0.511s]
      [INFO] Apache UIMA Java Framework Core ....................... SUCCESS [2.981s]
      [INFO] Java Vinci Library .................................... SUCCESS [0.054s]
      [INFO] Apache UIMA Java Vinci Adapter ........................ SUCCESS [0.087s]
      [INFO] Apache UIMA Java Collection Processing Engine ......... SUCCESS [0.063s]
      [INFO] Apache UIMA Java Framework - Document Annotation ...... SUCCESS [0.067s]
      [INFO] Apache UIMA Java SDK Tools ............................ SUCCESS [0.091s]
      [INFO] Apache UIMA Java SDK Examples ......................... SUCCESS [0.079s]
      [INFO] Apache UIMA Java SOAP Adapter ......................... SUCCESS [4.458s]
      [INFO] Apache UIMA Utility Classes For Component JUnit Tests . SUCCESS [0.045s]
      [INFO] Apache UIMA Debug Eclipse Plugin ...................... SUCCESS [36.225s]
      [INFO] Apache UIMA JCasGen Eclipse Plugin .................... SUCCESS [4.314s]
      [INFO] Apache UIMA Configurator Eclipse Plugin ............... SUCCESS [19.509s]
      [INFO] Apache UIMA PEAR Packager Eclipse Plugin .............. SUCCESS [0.396s]
      [INFO] Apache UIMA Runtime Plugin ............................ SUCCESS [0.006s]
      [INFO] ------------------------------------------------------------------------
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 1 minute 14 seconds
      [INFO] Finished at: Mon Jan 15 20:21:02 EST 2007
      [INFO] Final Memory: 7M/17M
      [INFO] ------------------------------------------------------------------------
      
  • Setup Eclipse:
    • go to Window > Preferences... In the Preferences Window select:
      Java > Build Path > Classpath
    • set a new environment variable M2_REPO to Ëœ/.m2/repository on unix or mac and %USERPROFILE%\.m2\repository on windows

      Note:

      You should not have to do this, if you've set up Eclipse using the Maven command
      mvn -Declipse.workspace=<eclipse workspace dir> eclipse:add-maven-repo
      This command adds a maven repository to your machine, and sets up the M2_REPO Eclipse Java Build Path variable to reference it.

    • if no refresh and rebuild is started automatically, do it manually

No errors should now exist in the uima workspace

  • No labels