Sync jboss modules and jbossdatahome between devs

78 views Asked by At

We're using local jboss 7 instances (maven jboss plugin) with custom modules for local development. Each dev can work on multiple projects. For each project, each dev needs to have the proper jboss modules and jbossdatahome folder. Each dev needs the same path to these folders, as they are hard coded in the maven pom (maven-jboss-plugin config).

I truly hate this setup and the administation chore (when changing projects) that comes with it.

How can we conveniantly sync the modules , jboss config & jbossdatahome between all dev's for each project?

My initial thought would be to put everything in the SVN folder of each project, but as modules contain jars (and the jboss instance itself is also rather big), I guess it would soon get too big.

I'd like some kind of portable maven config. But haven't found any solution..

Anyone with suggestions?

1

There are 1 answers

1
Mike On BEST ANSWER

You can use the JBoss CLI to script the configuration of your JBoss instance. You'll need to make sure you have the JAR files available somewhere though.

If you create a file, e.g. module-add.cli with the following in it:

module add --name=org.mysql --resources=mysql-connector-java-5.1.18-bin.jar --dependencies=javax.api,javax.transaction.api 
/subsystem=datasources/jdbc-driver=mysql:add(driver-module-name=org.mysql,driver-name=mysql,driver-class-name=com.mysql.jdbc.Driver)
/subsystem=datasources/data-source=MySQLDS:add(jndi-name=java:jboss/datasources/MySQLDS, driver-name=mysql, connection-url=jdbc:mysql://localhost:3306/as7development,user-name=root,password=admin)

And you stored all your JARs in a known repository (I've used Nexus in the past) you can create a simple bash script to get it set up, e.g:

wget http://url.to.nexus/hosted/jboss/module.jar
/$JBoss-Home/bin/jboss-cli.sh -c --file=module-add.cli

This would download your module.jar to the same directory you're running your script from. You might prefer to use all absolute paths for consistency's sake (and to make the script more reusable with fewer prerequisites)

It's not perfect, but it works.

You could also team this approach up with something like Vagrant to give you a predictable way to provision and configure an environment.

Source for CLI script: http://www.mastertheboss.com/jboss-server/jboss-script/installing-a-jboss-as-7-module-using-the-cli