-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
HHH-18500 Gradle plugin crashes on module-info when extended enhancement is set #8794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...-gradle-plugin/src/test/java/org/hibernate/orm/tooling/gradle/ModuleInfoProjectTests.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| /* | ||
| * Hibernate, Relational Persistence for Idiomatic Java | ||
| * | ||
| * License: GNU Lesser General Public License (LGPL), version 2.1 or later. | ||
| * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html. | ||
| */ | ||
| package org.hibernate.orm.tooling.gradle; | ||
|
|
||
| import java.nio.file.Path; | ||
|
|
||
| import org.junit.jupiter.api.Test; | ||
| import org.junit.jupiter.api.io.TempDir; | ||
|
|
||
|
|
||
| /** | ||
| * Basic functional tests | ||
| * | ||
| * @author Steve Ebersole | ||
| */ | ||
| class ModuleInfoProjectTests extends TestsBase { | ||
|
|
||
| @Override | ||
| protected String getProjectName() { | ||
| return "simple-moduleinfo"; | ||
| } | ||
|
|
||
| @Override | ||
| protected String getSourceSetName() { | ||
| return "main"; | ||
| } | ||
|
|
||
| @Override | ||
| protected String getLanguageName() { | ||
| return "java"; | ||
| } | ||
|
|
||
| @Override | ||
| protected String getCompileTaskName() { | ||
| return "compileJava"; | ||
| } | ||
|
|
||
| @Test | ||
| @Override | ||
| public void testEnhancement(@TempDir Path projectDir) throws Exception { | ||
| super.testEnhancement( projectDir ); | ||
| } | ||
|
|
||
| @Test | ||
| @Override | ||
| public void testEnhancementUpToDate(@TempDir Path projectDir) throws Exception { | ||
| super.testEnhancementUpToDate( projectDir ); | ||
| } | ||
| } |
40 changes: 40 additions & 0 deletions
40
tooling/hibernate-gradle-plugin/src/test/resources/projects/simple-moduleinfo/build.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| /* | ||
| * Hibernate, Relational Persistence for Idiomatic Java | ||
| * | ||
| * License: GNU Lesser General Public License (LGPL), version 2.1 or later | ||
| * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html | ||
| */ | ||
|
|
||
| plugins { | ||
| id 'java' | ||
| id 'org.hibernate.orm' | ||
| } | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
|
|
||
| maven { | ||
| name 'jboss-snapshots-repository' | ||
| url 'https://repository.jboss.org/nexus/content/repositories/snapshots' | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| // NOTE : The version used here is irrelevant in terms of testing the plugin. | ||
| // We just need a resolvable version | ||
| implementation 'org.hibernate.orm:hibernate-core:6.1.0.Final' | ||
| implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1' | ||
| } | ||
|
|
||
| hibernate { | ||
| useSameVersion = false | ||
| enhancement { | ||
| enableLazyInitialization.set(true) | ||
| lazyInitialization = true | ||
|
|
||
| enableDirtyTracking.set(true) | ||
| dirtyTracking = true | ||
|
|
||
| enableExtendedEnhancement.set(true) | ||
| } | ||
| } |
Empty file.
29 changes: 29 additions & 0 deletions
29
...dle-plugin/src/test/resources/projects/simple-moduleinfo/src/main/java/TheEmbeddable.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| /* | ||
| * Hibernate, Relational Persistence for Idiomatic Java | ||
| * | ||
| * License: GNU Lesser General Public License (LGPL), version 2.1 or later. | ||
| * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html. | ||
| */ | ||
| import jakarta.persistence.Embeddable; | ||
|
|
||
| @Embeddable | ||
| public class TheEmbeddable { | ||
| private String valueOne; | ||
| private String valueTwo; | ||
|
|
||
| public String getValueOne() { | ||
| return valueOne; | ||
| } | ||
|
|
||
| public void setValueOne(String valueOne) { | ||
| this.valueOne = valueOne; | ||
| } | ||
|
|
||
| public String getValueTwo() { | ||
| return valueTwo; | ||
| } | ||
|
|
||
| public void setValueTwo(String valueTwo) { | ||
| this.valueTwo = valueTwo; | ||
| } | ||
| } |
88 changes: 88 additions & 0 deletions
88
...-gradle-plugin/src/test/resources/projects/simple-moduleinfo/src/main/java/TheEntity.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| /* | ||
| * Hibernate, Relational Persistence for Idiomatic Java | ||
| * | ||
| * License: GNU Lesser General Public License (LGPL), version 2.1 or later. | ||
| * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html. | ||
| */ | ||
| import jakarta.persistence.ElementCollection; | ||
| import jakarta.persistence.Embedded; | ||
| import jakarta.persistence.Entity; | ||
| import jakarta.persistence.Id; | ||
| import jakarta.persistence.JoinColumn; | ||
| import jakarta.persistence.ManyToOne; | ||
| import jakarta.persistence.OneToMany; | ||
|
|
||
| import org.hibernate.annotations.BatchSize; | ||
|
|
||
| import java.util.Set; | ||
|
|
||
| @Entity | ||
| @BatchSize( size = 20 ) | ||
| public class TheEntity { | ||
| @Id | ||
| private Integer id; | ||
| private String name; | ||
|
|
||
| @Embedded | ||
| private TheEmbeddable theEmbeddable; | ||
|
|
||
| @ManyToOne | ||
| @JoinColumn | ||
| private TheEntity theManyToOne; | ||
|
|
||
| @OneToMany( mappedBy = "theManyToOne" ) | ||
| private Set<TheEntity> theOneToMany; | ||
|
|
||
| @ElementCollection | ||
| @JoinColumn( name = "owner_id" ) | ||
| private Set<TheEmbeddable> theEmbeddableCollection; | ||
|
|
||
|
|
||
| public Integer getId() { | ||
| return id; | ||
| } | ||
|
|
||
| public void setId(Integer id) { | ||
| this.id = id; | ||
| } | ||
|
|
||
| public String getName() { | ||
| return name; | ||
| } | ||
|
|
||
| public void setName(String name) { | ||
| this.name = name; | ||
| } | ||
|
|
||
| public TheEmbeddable getTheEmbeddable() { | ||
| return theEmbeddable; | ||
| } | ||
|
|
||
| public void setTheEmbeddable(TheEmbeddable theEmbeddable) { | ||
| this.theEmbeddable = theEmbeddable; | ||
| } | ||
|
|
||
| public TheEntity getTheManyToOne() { | ||
| return theManyToOne; | ||
| } | ||
|
|
||
| public void setTheManyToOne(TheEntity theManyToOne) { | ||
| this.theManyToOne = theManyToOne; | ||
| } | ||
|
|
||
| public Set<TheEntity> getTheOneToMany() { | ||
| return theOneToMany; | ||
| } | ||
|
|
||
| public void setTheOneToMany(Set<TheEntity> theOneToMany) { | ||
| this.theOneToMany = theOneToMany; | ||
| } | ||
|
|
||
| public Set<TheEmbeddable> getTheEmbeddableCollection() { | ||
| return theEmbeddableCollection; | ||
| } | ||
|
|
||
| public void setTheEmbeddableCollection(Set<TheEmbeddable> theEmbeddableCollection) { | ||
| this.theEmbeddableCollection = theEmbeddableCollection; | ||
| } | ||
| } |
5 changes: 5 additions & 0 deletions
5
...radle-plugin/src/test/resources/projects/simple-moduleinfo/src/main/java/module-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| module test { | ||
| requires org.hibernate.orm.core; | ||
| requires jakarta.persistence; | ||
| requires jakarta.annotation; | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.