Source code checkout with Eclipse
- Use the SVN plugin for Eclipse (get it here: http://subclipse.tigris.org ).
- Open the view: SVN Repository, and add the URL location:
Note: the website is under .../incubator/uima/site
Note: for readonly access, you can use http: instead of https:
- 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.
- Choose "Checkout as a project in the workspace"
This will create an Eclipse simple project.
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, set from the maven pom:
- open a commmand line window,
- cd to the project directory, and
- run the command
"mvn eclipse:eclipse"
. (Note: this works for Java projects, but hasn't been tried for eclipse plugins or the docbook / website.)
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).
Note:
The uimaj-ep-runtime project needs to be extracted for the "mvn install"
to work. However, if the project is open in Eclipse, this can cause problems when launching another instance of Eclipse from within this Eclipse (something done when debugging Eclipse plugins). What happens is that Eclipse attempts to use it to find the UIMA runtime for the Eclipse plugins that need this, and things will fail in the launched Eclipse because this project doesn't actually have the runtime in it (the Jars have been left out to avoid duplicating Jars).
The fix is to go ahead and checkout this project, but once checked out, select it in Eclipse, and say close project
.
Quickstart Guide for Eclipse:
Follow these steps for the first setup. It will create a working environment without a sophisticated configuration.
- Checkout source code:
- Use the SVN plugin for Eclipse (via updatesite from here: http://subclipse.tigris.org/update_1.0.x).
- Open the view: SVN Repository, and add the URL location:
https://svn.apache.org/repos/asf/incubator/uima/uimaj/trunk
- Expand this and mark all projects
- right-click, and say "checkout"
- Choose "Checkout as a project in the workspace"
- Building with Maven:
- install Maven on your computer (get it from here: http://maven.apache.org/)
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 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 an Eclipse Java Build Path variable to reference it.
- go to Window > Preferences... In the Preferences Window select:
-
- if no refresh and rebuild is started automatically, do it manually
- if no refresh and rebuild is started automatically, do it manually
No errors should now exist in the uima workspace