Skip to content

Commit 73c5d57

Browse files
barreirosebersole
authored andcommitted
HHH-9813 - Documentation for the Hibernate Enhance Maven Plugin
1 parent ebb2ca1 commit 73c5d57

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

documentation/src/main/asciidoc/topical/bytecode/BytecodeEnhancement.adoc

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,51 @@ Once enhancement overall is enabled, the default for these 3 properties is `true
9090
=== Ant Task
9191

9292

93-
=== Maven Plugin
93+
=== Maven Plugin
94+
95+
The Hibernate Maven plugin provides a convenient way to enhance the domain model at build-time when using Maven as the
96+
build environment. Much like the Gradle plugin, the current bytecode enhancement capabilities that can be configured
97+
on the plugin are:
98+
99+
* `enableLazyInitialization`
100+
* `enableDirtyTracking`
101+
* `enableAssociationManagement`
102+
103+
These are all enabled by default. Even if the plugin is enabled, the bytecode enhancement can be bypassed by disabling
104+
all the capabilities.
105+
106+
To use the Hibernate Maven plugin on a build it must added to the model (pom.xml) along with other plugins that may be
107+
already in use. The XML snippet below is an example of how to declare and configure the plugin.
108+
109+
[[maven-plugin-apply-example]]
110+
.Apply the plugin
111+
====
112+
[source, XML]
113+
----
114+
<build>
115+
<plugins>
116+
[...]
117+
<plugin>
118+
<groupId>org.hibernate.orm.tooling</groupId>
119+
<artifactId>hibernate-enhance-maven-plugin</artifactId>
120+
<version>$currentHibernateVersion</version>
121+
<executions>
122+
<execution>
123+
<configuration>
124+
<enableLazyInitialization>true</enableLazyInitialization>
125+
<enableDirtyTracking>true</enableDirtyTracking>
126+
<enableAssociationManagement>true</enableAssociationManagement>
127+
</configuration>
128+
<goals>
129+
<goal>enhance</goal>
130+
</goals>
131+
</execution>
132+
</executions>
133+
</plugin>
134+
[...]
135+
</plugins>
136+
</build>
137+
----
138+
====
139+
140+

0 commit comments

Comments
 (0)