The Maven compilation files for OneCMDB

Here comes the Maven compilation files for OneCMDB.

OneCMDB is an Open Source CMDB, Configuration Management Database published under GPL Version 2.

It was developed by Lokomo Systems AB and its homepage is http://www.onecmdb.org/ .

OneCMDB is excellent so deserve studying. (Thank you for opening the source codes, Lokomo!)

A runnable and debuggable project will be of great help when reading the source codes.

Unfortunately, although Lokomo provides the source codes in the installation package, it lacks the compilation files.

I want to understand the source codes of OneCMDB well so I tried to compile OneCMDB with Maven.

And I succeeded in compiling it and running it in Eclipse Indigo after many attempts.

Compilation Instructions

OK. Here is the instructions for setup the Eclipse project:

(Notes: I compiled OneCMDB on Windows, please adapt the commands to Linux style if you try to compile it on Linux. And I am not sure it could work on Linux or not.)

  1. Install JDK6, Eclipse (or STS; with Maven plug-in integrated), Tomcat 6 and Maven 3.
  2. Install OneCMDB 2.1.0. Download page.
  3. Download source from Github: https://github.com/Konca/OneCMDBwithMaven , or download “MavenOneCMDB.zip” from my SkyDrive account.
  4. Modify the file “repository.cfg” to let “onecmdb-desktop” module know the position of the repository of the installed official OneCMDB. See details.
  5. Install many jar files from installed OneCMDB. See details.
  6. Launch the HSQLDB. See details.
  7. Import (“Existing Maven Projects”) the all projects in the compilation package into your Eclipse workspace.
  8. Configure “Tomcat 6” server in the workspace.
  9. Add these 4 projects to “Tomcat 6” server : onecmdb-desktop, onecmdb-itil, onecmdb-modeller, ROOT.
  10. Launch “Tomcat 6” server (debug mode is better) in Eclipse.
  11. Finally, you could enjoy the debuggable OneCMDB by open this link in a web browser: http://localhost:8080/onecmdb-desktop/

Lets “onecmdb-desktop” get the repository

Open the “org.onecmdb.ui.gwt.desktop\src\main\resources\repository.cfg” file, and put the full path of the repository of installed OneCMDB in it. The following is a sample on Windows:

 XML |  copy code |? 
1
# The Root path of the repository.
2
repositoryRoot=d:/Program Files (x86)/OneCMDB/2.1.0/repository

Installs Many JAR files

For unknown reasons, many jar files couldn’t be download from Maven Central Repository, so you have to install them to local Maven repository from installed OneCMDB by the commands as following.

Please execute them at the folder of Tomcat 5.5.17 contained in the install OneCMDB.

And please change “\” to “/” if you do it on Linux.

 DOS |  copy code |? 
01
mvn<!--DVFMTSC--> install:install−file<!--DVFMTSC--> −Dfile=webapps\onecmdb−desktop\WEB−INF\lib\gxt−1.2.4.jar<!--DVFMTSC--> −DgroupId=com.extjs<!--DVFMTSC--> −DartifactId=gxt<!--DVFMTSC--> −Dversion=1.2.4<!--DVFMTSC--> −Dpackaging=jar
02
mvn<!--DVFMTSC--> install:install−file<!--DVFMTSC--> −Dfile=webapps\itil\WEB−INF\lib\gwtiger.jar<!--DVFMTSC--> −DgroupId=com.googlecode<!--DVFMTSC--> −DartifactId=gwtiger<!--DVFMTSC--> −Dversion=0.1<!--DVFMTSC--> −Dpackaging=jar
03
mvn<!--DVFMTSC--> install:install−file<!--DVFMTSC--> −Dfile=webapps\ROOT\WEB−INF\lib\toplink−api−1.0.0.jar<!--DVFMTSC--> −DgroupId=com.oracle.toplink<!--DVFMTSC--> −DartifactId=toplink−api<!--DVFMTSC--> −Dversion=1.0.0<!--DVFMTSC--> −Dpackaging=jar
04
mvn<!--DVFMTSC--> install:install−file<!--DVFMTSC--> −Dfile=webapps\ROOT\WEB−INF\lib\jmxri−1.2.1.jar<!--DVFMTSC--> −DgroupId=javax.management<!--DVFMTSC--> −DartifactId=jmxri<!--DVFMTSC--> −Dversion=1.2.1<!--DVFMTSC--> −Dpackaging=jar
05
mvn<!--DVFMTSC--> install:install−file<!--DVFMTSC--> −Dfile=webapps\ROOT\WEB−INF\lib\jta−1.0.1B.jar<!--DVFMTSC--> −DgroupId=javax.transaction<!--DVFMTSC--> −DartifactId=jta<!--DVFMTSC--> −Dversion=1.0.1B<!--DVFMTSC--> −Dpackaging=jar
06
mvn<!--DVFMTSC--> install:install−file<!--DVFMTSC--> −Dfile=webapps\ROOT\WEB−INF\lib\jmxremote−1.0.1_04.jar<!--DVFMTSC--> −DgroupId=javax.management<!--DVFMTSC--> −DartifactId=jmxremote<!--DVFMTSC--> −Dversion=1.0.1_04<!--DVFMTSC--> −Dpackaging=jar
07
mvn<!--DVFMTSC--> install:install−file<!--DVFMTSC--> −Dfile=webapps\ROOT\WEB−INF\lib\jmxremote_optional−1.0.1_04.jar<!--DVFMTSC--> −DgroupId=javax.management<!--DVFMTSC--> −DartifactId=jmxremote_optional<!--DVFMTSC--> −Dversion=1.0.1_04<!--DVFMTSC--> −Dpackaging=jar
08
mvn<!--DVFMTSC--> install:install−file<!--DVFMTSC--> −Dfile=webapps\ROOT\WEB−INF\lib\connector−1.0.jar<!--DVFMTSC--> −DgroupId=javax.resource<!--DVFMTSC--> −DartifactId=connector<!--DVFMTSC--> −Dversion=1.0<!--DVFMTSC--> −Dpackaging=jar
09
mvn<!--DVFMTSC--> install:install−file<!--DVFMTSC--> −Dfile=webapps\ROOT\WEB−INF\lib\jaas−1.0.01.jar<!--DVFMTSC--> −DgroupId=javax.security<!--DVFMTSC--> −DartifactId=jaas<!--DVFMTSC--> −Dversion=1.0.01<!--DVFMTSC--> −Dpackaging=jar
10
mvn<!--DVFMTSC--> install:install−file<!--DVFMTSC--> −Dfile=webapps\ROOT\WEB−INF\lib\jacc−1.0.jar<!--DVFMTSC--> −DgroupId=javax.security<!--DVFMTSC--> −DartifactId=jacc<!--DVFMTSC--> −Dversion=1.0<!--DVFMTSC--> −Dpackaging=jar
11
mvn<!--DVFMTSC--> install:install−file<!--DVFMTSC--> −Dfile=webapps\ROOT\WEB−INF\lib\jdbc−stdext−2.0.jar<!--DVFMTSC--> −DgroupId=javax.sql<!--DVFMTSC--> −DartifactId=jdbc−stdext<!--DVFMTSC--> −Dversion=2.0<!--DVFMTSC--> −Dpackaging=jar
12

Launching HSQLDB

Launching HSQLDB is pretty simple. And it will store the data in the “current working directory”.

The following is a launching script on Windows:

 DOS |  copy code |? 
1
@echo off
2
cd data\
3
title HSQLDB is running...
4
java −classpath "../lib/hsqldb.jar" org.hsqldb.Server

Exception

OneCMDB uses Java applets (with Prefuse lib) to show pretty and animated graphs of the CI(Configuration Item) and the relationship between them.

And this page doesn’t describe how to debug the Java applets.

Experience

  1. You could upload a JAR file to Maven Central Repository (Advanced Search -> CHOOSE FILE) to let it to match precisely the coordinate or this JAR file.
  2. When a JAR file could not be match precisely, try to figure out it’s a modified version or not and what bug of it have been fixed.
    • The hibernate 3.2.0.ga in OneCMDB is a fixed version with the modification to SubqueryExpression.java. Without this fix, the “Import model” function will not work. And it took me more than 10 hours to debug. And finally, I found the fix to SubqueryExpression.java by invoking jd-gui to reverse the two hibernate JAR files to JAVA files. And then I tried hibernate 3.2.7.ga and it works.

Reference



Leave a Reply