February 22, 2009

New stuff for JBoss in the Maven EAR plugin

It's been a number of years ago that I contributed to some open source project. To be more accurate, it was some four years ago that I submitted some bug fixes and features to OpenSymphony's WebWork 2 (which is now known as Struts 2.0).

After all these years I once again modified an open source project to do something I needed, and this time it was Maven's EAR Plug-in.

On release of version 2.3.2, you will be able to do following:
  • Generate XML-files for JBoss 5.0
  • Specify an alternate 3rd-party library directory
  • Specify both the loader-repository and loader-repository-config sections
  • Set an alternative configParserClass and loaderRepositoryClass
As an example, you can now set following configuration for the EAR plugin:

<plugin>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
...
<jboss>
<version>5</version>
<library-directory>/APP-INF/lib</library-directory>
<loader-repository>org.mindbug:loader=${project.build.finalName}.ear</loader-repository>
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</jboss>
</configuration>
</plugin>

... which would create a jboss-app.xml with the corresponding configuration.

Anyway, if you can't wait for the release of version 2.3.2, just fetch the source code and compile it.

Enjoy! :)

2 comments:

Lo said...

Hey Daniel,

Any reason why you chose to do this in the maven-ear-plugin instead of using the existing maven-jboss-packaging-plugin?

Daniel Pfeifer said...

Hi Lo,

no particular reason other than the fact that it was convenient to add new features to an existing core-plugin.

/Daniel