maven-har-plugin 0.9

maven-har-plugin plugin generates Hibernate Archive (HAR) files.
maven-har-plugin plugin generates Hibernate Archive (HAR) files. It can be used to generate hibernate archives, or HAR files for short.

HAR files are used by RedHat's JBoss Application Server to configure Hibernate's object-relational mappings when the app server starts up.


The following document explains the process of setting up a maven project that produces har files using maven-har-plugin. If you want to get up and running quickly, try using maven-archetype-har.

File Layout

Below is an example file layout for a har project. Note, jboss-service.xml is a required resource and must appear in META-INF.

|-- src
| `-- main
| |-- java
| | `-- [your project's package]
| | `--
| `-- resources
| |-- META-INF
| | `-- jboss-service.xml
| `-- [your project's package]
| `-- FooPojo.hbm.xml
`-- pom.xml

Add the Plugin

You need to reference the plugin in the pom.xml for your project. To do so, add the following to the pom.xml for your project.

< project>
< build>
< plugins>
< plugin>
< groupId>net.sf.maven-har< /groupId>
< artifactId>maven-har-plugin< /artifactId>
< version>0.9< /version>
< extensions>true< /extensions>
< /plugin>
< /plugins>
< /build>
< /project>

Set Packaging to har

Simply listing maven-har-plugin as a build plugin will not cause it to be executed during packaging. You must explicitly set < packaging/ > to har.
< project >
< packaging>har< /packaging>
< /project>

Generate the har

If < packaging/ > is set to har, then this plugin will be executed executed during the package phase. To execute the plugin manually, use this command:

mvn package

The generated har file will be placed in the target directory.

last updated on:
September 7th, 2007, 14:06 GMT
developed by:
Tom Cort
license type:
MPL (Mozilla Public License) 
ROOT \ Programming \ Assembler Tools


In a hurry? Add it to your Download Basket!

user rating



Rate it!

Add your review!