Monday, June 8, 2015

How to install setup maven repository in jboss brms bpmsuite rhel7 centos7


This is quite simple thing.
If you are going to start jboss brms fresh instance without installing maven in your machine, you cannot start the server and it will ask you to set M2_HOME (M2_HOME is not set, cannot start kie workbench)
First you have to install apache maven in your machine,
Download the zip file from http://maven.apache.org/download.cgi site.
Then unzip the file,

#unzip apache-maven-bin.zip
 
Copy the extracted file to /opt/ like below and create a link to usr/bin/,

#cp apache-maven/ /opt/maven
#ln -s /opt/maven/bin/mvn /usr/bin/mvn
 
Now you have to setup environment variables using below commands.

#vi /etc/profile.d/maven.sh
 
Add the following contents:

#!/bin/bash
M2_HOME=/opt/maven
PATH=$M2_HOME/bin:$PATH
export M2_HOME
export PATH
export CLASSPATH=.
 
Save and close the file and give privileges using below command

#chmod +x /etc/profile.d/maven.sh
 
Run below command to make variables permanent,

#source /etc/profile.d/maven.sh

Now you have successfully installed maven in your machine,
Check maven version using below command

#mvn –-version

Note that if it says about permission problem in mvn, go to the directory location and give +x permissions to the file and again try to view version.

Now you have maven and you can start jboss brms without problems. But before starting the server you need to map jboss-brms-bpmsuite-<version>-maven-repository repository to your maven installation settings file.

First download brms repository from Redhat site.

By default there is no setting.xml file in your fresh maven installation location in ~/.m2

Create settings.xml file and insert below sample maven profile details to the settings.xml,

#cd ~/.m2
#vi settings.xml

Add below code,

<profile>
<id>jboss-brms-bpmsuite-repository</id>
<repositories>
<repository>
<id>jboss-brms-bpmsuite-repository</id>
<url>file://<repository_location></url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>jboss-brms-bpmsuite-plugin-repository</id>
<url>file://<repository_location></url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>

<activeProfiles>
<!-- Optionally, make the repository active by default -->
<activeProfile>jboss-brms-bpmsuite-repository</activeProfile>
</activeProfiles>

After done this configuration, you have successfully installed the jboss brms and can run and access brms server without problems.

No comments:

Post a Comment