@@ -9,8 +9,14 @@ The following sections illustrate how both <<tooling-maven-enhancement,bytecode
99Hibernate provides a https://maven.apache.org/[Maven] plugin capable of providing
1010build-time enhancement of the domain model as they are compiled as part of a Maven
1111build. See the section on <<BytecodeEnhancement>> for details
12- on the configuration settings. By default, all enhancements are disabled.
12+ on the configuration settings.
1313
14+ [[maven-enhance-goal]]
15+ ===== *Enhance Goal* =====
16+
17+ An example of using the `enhance` goal of the plugin is shown below. By default the plugin will
18+ perform bytecode enhancement for lazy initialization and dirty tracking. See <<maven-enhance-configuration, below>>
19+ for more details on the available parameters.
1420
1521.Apply the Bytecode Enhancement plugin
1622====
@@ -20,6 +26,136 @@ include::extras/maven-example.pom[]
2026----
2127====
2228
29+ [[maven-enhance-configuration]]
30+ ===== *Enhance Configuration* =====
31+
32+ [[maven-enhance-classesDirectory-parameter]]
33+ ====== `*classesDirectory*` ======
34+ This parameter points to the folder in which to look for classes to enhance.
35+ It defaults to the value of `{project.build.directory}/classes` and thus in most cases to `target/classes`.
36+ While this parameter is mandatory, its value will be ignored if the <<maven-enhance-filesets-parameter, fileSets>>
37+ parameter is specified.
38+
39+ ====
40+ [source,xml]
41+ ----
42+ [...]
43+ <execution>
44+ <configuration>
45+ <classesDirectory>path-to-some-folder</classesDirectory>
46+ </configuration>
47+ [...]
48+ </execution>
49+ [...]
50+ ----
51+ ====
52+
53+ [[maven-enhance-filesets-parameter]]
54+ ====== `*fileSets*` ======
55+ This parameter comes in handy when you need to filter the classes that you want to enhance. More information
56+ on how to use filesets is to be found on the
57+ https://maven.apache.org/shared/file-management/fileset.html[fileset documentation page].
58+ This is an optional parameter but if it is specified the
59+ <<maven-enhance-classesDirectory-parameter, classesDirectory>> parameter described above is ignored.
60+
61+ ====
62+ [source,xml]
63+ ----
64+ [...]
65+ <execution>
66+ <configuration>
67+ <fileSets>
68+ <fileset dir="path-to-some-folder">
69+ <exclude name='Baz.class' />
70+ </fileset>
71+ </fileSets>
72+ </configuration>
73+ [...]
74+ </execution>
75+ [...]
76+ ----
77+ ====
78+
79+ [[maven-enhance-enableLazyInitialization-parameter]]
80+ ===== `*enableLazyInitialization*` =====
81+ This parameter has a default value of `true`. It indicates that the enhance goal should perform the changes
82+ to enable lazy loading. To disable, set the value of this attribute to `false`.
83+ The parameter has been deprecated for removal.
84+
85+ ====
86+ [source,xml]
87+ ----
88+ [...]
89+ <execution>
90+ <configuration>
91+ <enableLazyInitialization>false</enableLazyInitialization>
92+ </configuration>
93+ [...]
94+ </execution>
95+ [...]
96+ ----
97+ ====
98+
99+ [[maven-enhance-enableDirtyTracking-parameter]]
100+ ===== `*enableDirtyTracking*` =====
101+ This parameter has a default value of `true`. It indicates that the enhance task should perform the changes
102+ to enable dirty tracking. To disable, set the value of this attribute to `false`.
103+ The parameter has been deprecated for removal.
104+
105+ ====
106+ [source,xml]
107+ ----
108+ [...]
109+ <execution>
110+ <configuration>
111+ <enableDirtyTracking>false</enableDirtyTracking>
112+ </configuration>
113+ [...]
114+ </execution>
115+ [...]
116+ ----
117+ ====
118+
119+ [[maven-enhance-enableAssociationManagement-parameter]]
120+ ===== `*enableAssociationManagement*` =====
121+ This parameter has a default value of `false`. It indicates that the enhance task should not perform the changes
122+ to enable association management. To enable, set the value of this attribute to `true`.
123+
124+ ====
125+ [source,xml]
126+ ----
127+ [...]
128+ <execution>
129+ <configuration>
130+ <enableAssociationManagement>true</enableAssociationManagement>
131+ </configuration>
132+ [...]
133+ </execution>
134+ [...]
135+ ----
136+ ====
137+
138+ [[maven-enhance-enableExtendedEnhancement-paremeter]]
139+ ===== `*enableExtendedEnhancement*` =====
140+ This parameter has a default value of `false`. It indicates that the enhance task should not perform the changes
141+ to enable the extended enhancement (i.e. even on non-entities).
142+ To enable this, set the value of this attribute to `true`.
143+
144+ ====
145+ [source,xml]
146+ ----
147+ [...]
148+ <execution>
149+ <configuration>
150+ <enableExtendedEnhancement>true</enableExtendedEnhancement>
151+ </configuration>
152+ [...]
153+ </execution>
154+ [...]
155+ ----
156+ ====
157+
158+
23159[[tooling-maven-modelgen]]
24160==== Static Metamodel Generation
25161
0 commit comments