cachedb-import Setup

If your sources are stored in a source control manager and they are in XML format, we need to transform those sources to cls format. In such case, we will do it with cachedb-import. If your source is a Cache database or you are storing sources in cls format, then you can skip this step.

1. Download cachedb-import

1.1 Create the directory where you will deploy cachedb-import and the output folder

> mkdir C:\sonarqube\cachedb-import
> mkdir C:\sonarqube\cachedb-import\output

1.2 Visit the cachedb-import release section on Github, and download the latest version to the folder previously created

2. Setup default configuration

2.1 Create the properties file in UTF-8 encoding

C:\sonarqube\cachedb-import\db.properties
# Host where the Caché installation is.
# The default value is localhost.
#host=localhost

# Port to connect to.
# The default value is 1972.
#port=1972

# REQUIRED: Caché user
user=theuser

# REQUIRED: Caché user password
password=thepassword

# REQUIRED: Caché namespace in which the user has execution permissions
namespace=THENAMESPACE

# REQUIRED for connecting to IRIS
#iris=true

# OPTIONAL if you connect to Caché Database
# REQUIRED if you connect to IRIS Data Platform
# Don't use if for previous versions to Caché 2016.2
# If not specified, the default is empty
# Default webport in Caché and Ensemble is 57772
# Default webport in IRIS is 52773
#webport=

# OPTIONAL: Set to true if should be used SSL access
#webusessl=true
Remember: file encoding MUST be UTF-8 or you will get an error during build

1. Download cachedb-import

1.1 Create the work directories

$ mkdir /opt/sonarqube/cachedb-import
$ mkdir /opt/sonarqube/cachedb-import/output

1.2 Visit the cachedb-import release section on Github

1.3 Download the latest version so the cachedb-import directory

$ wget -P /opt/sonarqube/cachedb-import https://github.com/litesolutions/cachedb-import/releases/download/0.2/cachedb-import-0.2.jar

2. Setup default configuration

2.1 Create the properties file

/opt/sonarqube/cachedb-import/db.properties
# Host where the Caché installation is.
# The default value is localhost.
#host=localhost

# Port to connect to.
# The default value is 1972.
#port=1972

# REQUIRED: Caché user
user=theuser

# REQUIRED: Caché user password
password=thepassword

# REQUIRED: Caché namespace in which the user has execution permissions
namespace=THENAMESPACE

# REQUIRED for connecting to IRIS
#iris=true

# OPTIONAL if you connect to Caché Database
# REQUIRED if you connect to IRIS Data Platform
# Don't use if for previous versions to Caché 2016.2
# If not specified, the default is empty
# Default webport in Caché and Ensemble is 57772
# Default webport in IRIS is 52773
#webport=

# OPTIONAL: Set to true if should be used SSL access
#webusessl=true

3. Set cachedb-import ownership

3.1 If you are running the cachedb-import from a Continous Integration server, like Jenkins, you have to set proper ownership to allow the CI server to run. In our example, we will run in Apache Tomcat 8 (see Jenkins Installation), so we must set the tomcat8 group ownership

$ chown sonar:tomcat8 -R /opt/sonarqube/cachedb-import

3.2 Setup permissions

$ chmod 774 /opt/sonarqube/cachedb-import/output