How to configure JBoss B*MS 6 installation to point to a custom maven deployment repository?
Environment
- Red Hat JBoss Business Process Management Suite (BPMS) 6.x
- Red Hat JBoss Enterprise Business Rule Management System (BRMS) 6.x
Issue
We have two BRMS instances on the same server (xx and yy). Each instance have their own brms maven repo defined as follows:
xx -> <property name="org.guvnor.m2repo.dir" value="/home/hello/brmsMavenRepository_xx"/>
yy -> <property name="org.guvnor.m2repo.dir" value="/home/hello/brmsMavenRepository_yy"/>
Also, there is a Common Maven Repository (local m2 Repo) specified in settings.xml
as:
...
<localRepository>/home/hello/brmsMavenRepository</localRepository>
...
When uploading a jar dependency from only one of the instances, the classes in that jar can be seen in both instances as all uploaded jars will also be placed in the Common Maven Repository, see an example below:
jar1
has a dependency onjar2
;jar1
is uploaded inxx
instance fromArtifact Repository
page (business-central);
Note: after uploading it will be placed inbrmsMavenRepository_xx
andbrmsMavenRepository
(Common Maven Repository);xx
instance displays an error due to thejar2
be missing;jar2
is uploaded inyy
instance fromArtifact Repository
page;xx
instance is able to display classes fromjar2
even if it is uploaded from another instance;
- How to avoid this behaviour?
- How to configure JBoss B*MS 6 installation to point to a custom maven deployment repository?
Resolution
The default setup is that the products will look for your maven settings in the default settings.xml
as found set in the M2_HOME
variable or in the users home directory at .m2/settings.xml
.
The following system property can be added to JBoss EAP standalone.xml
configuration file to point to any file containing your custom settings:
kie.maven.settings.custom
it specifies the location of the maven configuration file where it can find its settings.
Below you can see how to configure an installation to point to your custom maven deployment repository by using a custom settings file we will call bpmsuite-settings.xml
:
<!-- Configuration property found in standalone.xml -->
<property name="kie.maven.settings.custom" value="/path/to/custom/bpmsuite-settings.xml" />
Note: You can also use this approach if you have two BRMS instances on the same server and needs to use different Maven Repository for each one of them.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments