Apache UIMA
Source Code
UIMA project logo

Search the site

 Apache UIMA Source Code

 Source Code Repository

Apache UIMA uses Subversion to manage its source code. If you're new to Subversion, you can check out the online book about Subversion. Note that we are currently using Subversion 1.1.x (there are separate versions of the book covering 1.0 and 1.1).

To receive notice of commits to the repository subscribe to uima-commits@incubator.apache.org by sending email to uima-commits-subscribe@incubator.apache.org.

Web Access to Subversion

If you just want to browse the source code, you can use the ViewCVS web interface to Subversion. This is current at all times.

 Checking Out Code Using Subversion

Anyone can check code out of Subversion. You only need to specify a username and password to update the Subversion repository, and only UIMA committers can do that. If you are a committer, are working from behind a firewall, or are connected to the internet through a proxy server, please see the sections below for more information.

Anonymous check out from Subversion

Use a command like:

% svn checkout http://svn.apache.org/repos/asf/incubator/uima/uimaj/trunk

Once you have Apache UIMA checked out you can update the source by executing the following command from within the UIMA directory.

% svn update

Access from behind a firewall

For those users who are stuck behind a corporate firewall which is blocking http access to the Subversion repository, you can try to access it via HTTPS:

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

Access through a proxy

The Subversion client can go through a proxy, if you configure it to do so. First, edit your "servers" configuration file to indicate which proxy to use. The files location depends on your operating system. On Linux or Unix it is located in the directory "~/.subversion". On Windows it is in "%APPDATA%\Subversion". (Try "echo %APPDATA%", note this is a hidden directory.)

There are comments in the file explaining what to do. If you don't have that file, get the latest Subversion client and run any command; this will cause the configuration directory and template files to be created.

Example : Edit the 'servers' file and add something like :

[global]
http-proxy-host = your.proxy.name
http-proxy-port = 3128

Committer access

Everyone can access the Apache UIMA Subversion repository via HTTPS, but Apache UIMA Committers must checkout the Subversion repository via HTTPS.

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

Checking Out Code using Eclipse

To access the SVN repository from Eclipse, you will need to install the Subclipse plugin from the update site http://subclipse.tigris.org/update_1.0.x. You can then check out code as follows:

  1. Bring up the "SVN Repositories" View (from Window -> Show View -> Other)
  2. Right click in the SVN Repositories View and select New -> Repository Location.
  3. Enter the URL http://svn.apache.org/repos/asf/incubator/uima/uimaj/trunk (or https://...)
  4. Shift-click to select all of the projects, right click and choose "Checkout..."
  5. Select "Check out into the workspace as projects" and click "Finish"
This will check out all of the code, but it will not build. See below for instructions on how to build from Eclipse.

 Submitting Code Changes

Submitting a patch

If you make changes to Apache UIMA, and would like to contribute it to the project, you should open a JIRA issue and discuss the merits of the proposal with the developer community. If there is agreement, create a patch and attach it to the JIRA issue.

To create a patch, execute the svn diff command. This creates a patch that can easily be uploaded to a JIRA issue. A good name for the patch includes the JIRA issue name, e.g. UIMA-104.patch. If there are several patches for the same JIRA issue, you might include a short identifying description, or your initials, e.g. UIMA-104.clr.patch

% svn diff > UIMA-104.clr.patch

Committing changes to subversion

To commit changes to the subversion repository, you must be an Apache UIMA committer. See get involved for information on how to become a committer and how to set up your password once you become a committer.

Once your password is set, you can use a command like this to commit:

$> svn commit --username your-username \
 Authentication realm: <https://svn.apache.org:443> \
 ASF Committers Password for 'your-username': your-password

You can also pass your password on the command line directly, but this is a security problem on multiuser unix computers (the command line arguments are available via the ps command). Here is the command if you are Windows or a single user unix computer:

$> svn commit --username your-username \
  --password your-password

Remember to replace 'your-username' and 'your-password' with your actual username and password on svn.apache.org.

Please also add to your commit statement an appropriate message that explains the changes you did. You can add a message when adding --message to your commit statement:

$> svn commit --username your-username \
  --password your-password --message your-message

Please always enter the JIRA issue key and additionally the JIRA issue link to the commit message. The issue key (e.g., UIMA-555) is important so that the JIRA SVN plugin can detect the changes automatically. Only specifying the issue link does not work correctly, for details please see the JIRA issue http://jira.atlassian.com/browse/SVN-37.

 Building UIMA from Source

Apache UIMA uses Maven 2 to do builds. Download Maven from http://maven.apache.org and add <maven-home>/bin to your path.

If you are building from a source distribution, and want to build the DocBooks from the Docbook sources, you need to set up your DocBook tooling by obtaining the needed parts, either from the UIMA SVN or from other places on the web (see below).

Building from the command line

$> cd uimaj
$> mvn install

The first time you try this, you will probably get an error that javax:activation:activation:jar:1.0.2 is not found. To resolve this, download activation.jar from http://java.sun.com/products/archive/javabeans/jaf102.html and execute the command:

$> mvn install:install-file \
  -DgroupId=javax.activation \
  -DartifactId=activation \
  -Dversion=1.0.2 \  
	-Dpackaging=jar \
  -Dfile=/path/to/file/activation.jar
then re-run the UIMA build with the command:
$> mvn install

This should build all of the jars and run the unit tests. Each jar will be located under the target subdirectory of its project, for example uimaj-core/target/uima-core.jar.

If you want to build just one of the "projects", and not the whole thing, cd to the project you want to build, and run mvn install there.

Building from Eclipse

  1. First, follow all the steps under "Building from the command line, above." You will only need to do this once.

  2. (Optional) If you want a new workspace for the maven work, start Eclipse and create a new workspace.

  3. In a command window, execute

    mvn -Declipse.workspace=<eclipse workspace dir> \
        eclipse:add-maven-repo
    This 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.

  4. Use Eclipse's SVN Repository explorer to checkout all the projects under uimaj/trunk. Tell it to create new Java projects for these.

  5. cd uimaj to switch to the Eclipse workspace for the uimaj project itself is (it has the top level POM), and run the command:

    mvn eclipse:eclipse

    If you haven't run the "install" using maven (because you forgot to follow all the steps under "Building from the command line, above"), you should do the command mvn install eclipse:eclipse. The "install" argument builds UIMA using maven, before the eclipse:eclipse goal is run. This is needed for the Eclipse Plugins that are part of UIMA - these projects have their "MANIFEST.MF" file built by maven from the information in the maven POMs. This step may take a few minutes because the "install" lifecycle includes running the unit tests.

    If you notice error messages that components need to be downloaded from the maven repository, it might tell you to redo the command using the -DdownloadSources=true parameter in order to check remote repositories for sources.

  6. Return to Eclipse, and if needed, select all the projects and push F5 to "refresh" them (because the previous command changed the .project and .classpath files). You can set your workspace to automatically refresh - in which case skip this step.

  7. The projects should now compile without errors, and have build paths which reference copies of things in your local maven repository.

  8. You can run the unit tests in Eclipse by right-clicking on a folder (for example uimaj-core/src/test/java) and selecting Run As -> JUnit Test. This will run all tests under that folder.

What to do if the tests fail

(Note: this kludgy procedure needs improvement)

If you get a failure messsage, in Eclipse, use the Search facility to search Files in the workspace of type "*.txt" for the string "<<< FAILURE!"

If not using Eclipse, you can use grep to accomplish the same thing.

You can bypass the tests by doing mvn -Dmaven.test.skip install. But please do this only after you've run without it and have verified the tests results.

How to build the full Apache UIMA distribution

Special setup to get around a Maven issue (March 2008)

Building the distribution requires that Maven uses ant version 1.7.0, but the Maven antrun plugin is configured to use ant 1.6.5. As a work-around, until a version of this plugin supporting ant 1.7.0 is available, please update your local maven repository entry for the antrun plugin as follows:

  • Locate the directory containing the antrun plugin's pom. On windows, it will be in C:\Documents and Settings\[user-name]\.m2\repository\org\apache\maven\plugins\maven-antrun-plugin\1.1. The file in this directory to modify is maven-antrun-plugin-1.1.pom.

  • Find the two dependency sections that refer to ant 1.6.5. In each of these change 2 things: the <version>1.6.5</version> to <version>1.7.0</version>, and above this, the <groupId>ant</groupId> to <groupId>org.apache.ant</groupId>

This will tell antrun to use ant 1.7.0.

Building the distribution requires some additional maven setup: you have to have Eclipse version 3.3 or later installed, and you have to indicate to maven where it is installed. In the examples below, this is shown as c:/your/path/to/eclipse. Note that you can type the slashes '/' as backslashes '\' in Windows -- it doesn't matter (both work). The path should be to an directory (which, by default is often named "eclipse" but can be named anything) containing the eclipse executable, and the subdirectory folders for Eclipse such as "plugins" and "features".

You can do this in one of 3 ways.

The first way is to create a maven "settings.xml" file, and store it in your local maven repository, (for instance, on Windows, in the directory: Documents and Settings/[user-login]/.m2). This file is useful for other things as well, such as specifying upload servers. The file contents that you need to specify the Eclipse location looks like this:

<settings xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation=
     "http://maven.apache.org/POM/4.0.0
      http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <profiles>
    <profile>
      <id>local-build-configuration</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <uima-maven-build-eclipse-home>
          c:/your/path/to/eclipse
        </uima-maven-build-eclipse-home>
      </properties>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>
      local-build-configuration
    </activeProfile>
  </activeProfiles>
</settings>
  

The second way to do this is to set an environment variable. Here's an example in Windows:

set ECLIPSE_HOME=c:/your/path/to/eclipse

The third way is to pass a command line argument to the maven command below, which looks like this:

-Duima-maven-build-eclipse-home=c:/your/path/to/eclipse

To build a distribution, first do a build as described in "Building from the command line". Then (assuming you set up the Eclipse path using one of the first 2 methods, execute the following:

$>cd ../uimaj-distr
$>mvn assembly:assembly
This will build the javadocs and the manual (using docbooks, as described below), will create the Eclipse update site for the Eclipse plugins, and will create .zip, .tar.gz, and .tar.bz2 archives of the full UIMA distribution in the uimaj-distr/target directory.

Building uima-docbooks

The UIMA Source distribution includes the uima-docbook-tool project, which is the tooling needed to build the Docbooks; the actual Docbook sources are in the uima-docbooks project, in the src directory. The DocBook tooling requires several components that are not included in the source distribution, but instead are automatically downloaded from the internet the first time you run the tools; you will be asked to accept the licenses for these components. Please read the README.FIRST and README files in the uima-docbook directory for important information about setting up the tooling. In particular, in order to get the images to be rendered in the PDF output, you must obtain the "Java Advanced Imaging" library from Sun.

Note that the uima-docbooks project is not built using Maven; it is built by an ant script. If you want to build the documentation without building the entire UIMA distribution, cd to the uima-docbooks directory, and run ant. This will build all 4 books into the uima-docbooks/target directory.

Note that each book is actually built twice - the first build only runs the transforms to get the links established and setup of cross reference database table. The second outputs the html and pdf files, using the cross reference database table just created.

Creating A4-size PDF documentation

If you don't live in the US, you may wish to create your PDF documentation in a different format, e.g., A4. To do this, edit the file uima-docbook-tool/properties/default.docbook.properties. It contains a line

paper.type = Letter

Change this setting to A4 and rebuild the documentation. Note: if you've previously built the documentation, you need to run ant clean first, as the build doesn't pick up on this change automatically.