Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

koentsje
Copy link
Member

@koentsje koentsje commented Aug 27, 2025

  • Add JavaDoc style documentation to the plugin parameters to improve the Maven plugin description
  • Change the parameter defaults for 'enableLazyInitialization' and 'enableDirtyTracking' to bring it in line with the former behaviour
  • Modify the 'groupId' and 'artifactId' in the documentation
  • Provide complete documentation in the User Guide in line with the Ant task for bytecode enhancement
  • Rename 'HibernateEnhancerMojo' to 'EnhancerMojo'
  • Rename 'HibernateEnhancerMojoTest' to 'EnhancerMojoTest'
  • Add integration test 'HibernateEnhancerMojoTestIT' to test the different configuration options
  • Make sure that the enhancer is not doing anything if all the enablement parameters are false

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


https://hibernate.atlassian.net/browse/HHH-19519

  - Add JavaDoc style documentation to the plugin parameters to improve the Maven plugin description
  - Change the parameter defaults for 'enableLazyInitialization' and 'enableDirtyTracking' to bring it in line with the former behaviour
  - Modify the 'groupId' and 'artifactId' in the documentation
  - Provide complete documentation in the User Guide in line with the Ant task for bytecode enhancement
  - Rename 'HibernateEnhancerMojo' to 'EnhancerMojo'
  - Rename 'HibernateEnhancerMojoTest' to 'EnhancerMojoTest'
  - Add integration test 'HibernateEnhancerMojoTestIT' to test the different configuration options
  - Make sure that the enhancer is not doing anything if all the enablement parameters are false

Signed-off-by: Koen Aers <[email protected]>
  - Add dependencies on 'maven-resolver-transport-http' and 'maven-resolver-connector-basic' for MavenCli to be able to download dependencies

Signed-off-by: Koen Aers <[email protected]>
@koentsje
Copy link
Member Author

koentsje commented Sep 2, 2025

This finally has built fine... Thanks @marko-bekhta for your help!

@yrodiere yrodiere self-assigned this Sep 11, 2025
Copy link
Member

@yrodiere yrodiere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I added a few comments below.

Comment on lines -50 to +77
defaultValue = "false",
defaultValue = "true",
required = true)
private boolean enableDirtyTracking;

/**
* A boolean that indicates whether or not to add lazy initialization
*/
@Deprecated(
forRemoval = true)
@Parameter(
defaultValue = "false",
defaultValue = "true",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly, this is actually fixing a regression in 7.0.
If so, can you please open an issue and use the corresponding Jira key in the relevant commit?

Comment on lines +64 to +65
@Deprecated(
forRemoval = true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to remove this? Is the plan to make it mandatory in the future?

A @deprecated blah blah in the javadoc would help remember :)

@@ -9,8 +9,14 @@ The following sections illustrate how both <<tooling-maven-enhancement,bytecode
Hibernate provides a https://maven.apache.org/[Maven] plugin capable of providing
build-time enhancement of the domain model as they are compiled as part of a Maven
build. See the section on <<BytecodeEnhancement>> for details
on the configuration settings. By default, all enhancements are disabled.
on the configuration settings.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, if anything changed, we will need the changes documented in migration-guide.adoc at the root of the repository. That needs to happen on the branch where the changes happened, though -- which I think would be 7.0.

From the top of my head, the changes are:

  1. Renaming of the plugin
  2. Default settings
  3. Maybe some Maven plugin configuration e.g. filesets?

Comment on lines +36 to +37
While this parameter is mandatory, its value will be ignored if the <<maven-enhance-filesets-parameter, fileSets>>
parameter is specified.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not mandatory if it has a default.

Suggested change
While this parameter is mandatory, its value will be ignored if the <<maven-enhance-filesets-parameter, fileSets>>
parameter is specified.
If both `classesDirectory` and <<maven-enhance-filesets-parameter,fileSets>> are set, `fileSets` takes precedence.

Comment on lines +58 to +59
This is an optional parameter but if it is specified the
<<maven-enhance-classesDirectory-parameter, classesDirectory>> parameter described above is ignored.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This is an optional parameter but if it is specified the
<<maven-enhance-classesDirectory-parameter, classesDirectory>> parameter described above is ignored.
If both <<maven-enhance-classesDirectory-parameter, classesDirectory>> and `fileSets` are set, `fileSets` takes precedence.


[[maven-enhance-enableAssociationManagement-parameter]]
===== `*enableAssociationManagement*` =====
This parameter has a default value of `false`. It indicates that the enhance task should not perform the changes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This parameter has a default value of `false`. It indicates that the enhance task should not perform the changes
This parameter has a default value of `false`. It indicates whether the enhance task should perform the changes

[[maven-enhance-enableAssociationManagement-parameter]]
===== `*enableAssociationManagement*` =====
This parameter has a default value of `false`. It indicates that the enhance task should not perform the changes
to enable association management. To enable, set the value of this attribute to `true`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
to enable association management. To enable, set the value of this attribute to `true`.
to enable <<BytecodeEnhancement-dirty-tracking-bidirectional,association management>>.


[[maven-enhance-enableExtendedEnhancement-paremeter]]
===== `*enableExtendedEnhancement*` =====
This parameter has a default value of `false`. It indicates that the enhance task should not perform the changes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This parameter has a default value of `false`. It indicates that the enhance task should not perform the changes
This parameter has a default value of `false`. It indicates whether the enhance task should perform the changes

Comment on lines +141 to +142
to enable the extended enhancement (i.e. even on non-entities).
To enable this, set the value of this attribute to `true`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems there is no documentation about this anywhere else, so I can't add a link there... but I guess we can describe it shortly:

Suggested change
to enable the extended enhancement (i.e. even on non-entities).
To enable this, set the value of this attribute to `true`.
to enable the extended enhancement: enhancement of non-entities to trigger lazy-loading and inline dirty tracking even when accessing entity fields directly.

Comment on lines +110 to +111
integrationTest.dependsOn rootProject.childProjects.'hibernate-core'.tasks.publishToMavenLocal
integrationTest.dependsOn publishToMavenLocal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we file an issue to improve on this and make the publishing "local" to the project, so as not to mess with the local Maven repository unnecessarily?
Or was that something you explored with Steve and gave up on due to limitations/bugs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants