Skip to content

Commit c65dc06

Browse files
committed
HBX-3000: Maven GenerateJava Mojo should generate annotated entities by default
- Initial setup of a integration test for GenerateJava with annotations Signed-off-by: Koen Aers <[email protected]>
1 parent 3e14db8 commit c65dc06

File tree

4 files changed

+136
-1
lines changed

4 files changed

+136
-1
lines changed

maven/pom.xml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,30 @@
177177
</execution>
178178
</executions>
179179
</plugin>
180+
<plugin>
181+
<artifactId>maven-invoker-plugin</artifactId>
182+
<version>${maven-invoker-plugin.version}</version>
183+
<configuration>
184+
<debug>true</debug>
185+
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
186+
<settingsFile>src/it/settings.xml</settingsFile>
187+
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
188+
<postBuildHookScript>verify</postBuildHookScript>
189+
<goal>install</goal>
190+
</configuration>
191+
<executions>
192+
<execution>
193+
<id>integration-test</id>
194+
<goals>
195+
<goal>run</goal>
196+
</goals>
197+
</execution>
198+
</executions>
199+
</plugin>
180200
</plugins>
181201
</build>
182202

183-
<reporting>
203+
<reporting>
184204
<plugins>
185205
<plugin>
186206
<artifactId>maven-project-info-reports-plugin</artifactId>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2018 - 2025 Red Hat, Inc.
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" basis,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<project xmlns="http://maven.apache.org/POM/4.0.0"
18+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
20+
<modelVersion>4.0.0</modelVersion>
21+
22+
<groupId>org.hibernate.tool.maven.test</groupId>
23+
<artifactId>generate-java-with-annotations</artifactId>
24+
<version>0.0.1-SNAPSHOT</version>
25+
26+
<dependencies>
27+
<dependency>
28+
<groupId>com.h2database</groupId>
29+
<artifactId>h2</artifactId>
30+
<version>@h2.version@</version>
31+
</dependency>
32+
</dependencies>
33+
34+
<build>
35+
<plugins>
36+
<plugin>
37+
<groupId>org.hibernate.tool</groupId>
38+
<artifactId>hibernate-tools-maven</artifactId>
39+
<version>@project.version@</version>
40+
<executions>
41+
<execution>
42+
<id>Entity generation</id>
43+
<phase>generate-sources</phase>
44+
<goals>
45+
<goal>hbm2java</goal>
46+
</goals>
47+
</execution>
48+
</executions>
49+
</plugin>
50+
</plugins>
51+
</build>
52+
53+
</project>

maven/src/it/settings.xml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2018 - 2025 Red Hat, Inc.
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" basis,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<settings>
18+
<profiles>
19+
<profile>
20+
<id>it-repo</id>
21+
<activation>
22+
<activeByDefault>true</activeByDefault>
23+
</activation>
24+
<repositories>
25+
<repository>
26+
<id>local.central</id>
27+
<url>@localRepositoryUrl@</url>
28+
<releases>
29+
<enabled>true</enabled>
30+
</releases>
31+
<snapshots>
32+
<enabled>true</enabled>
33+
</snapshots>
34+
</repository>
35+
<repository>
36+
<releases>
37+
<enabled>false</enabled>
38+
</releases>
39+
<snapshots>
40+
<enabled>true</enabled>
41+
</snapshots>
42+
<id>plexus-snapshots</id>
43+
<name>Plexus Snapshot Repository</name>
44+
<url>https://oss.sonatype.org/content/repositories/plexus-snapshots</url>
45+
</repository>
46+
</repositories>
47+
<pluginRepositories>
48+
<pluginRepository>
49+
<id>local.central</id>
50+
<url>@localRepositoryUrl@</url>
51+
<releases>
52+
<enabled>true</enabled>
53+
</releases>
54+
<snapshots>
55+
<enabled>true</enabled>
56+
</snapshots>
57+
</pluginRepository>
58+
</pluginRepositories>
59+
</profile>
60+
</profiles>
61+
</settings>

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
<!-- Plugins not managed by the JBoss parent POM: -->
108108
<maven-wrapper-plugin.version>3.3.2</maven-wrapper-plugin.version>
109109
<flatten-maven-plugin.version>1.7.0</flatten-maven-plugin.version>
110+
<maven-invoker-plugin.version>3.0.1</maven-invoker-plugin.version>
110111

111112
<!--
112113
We don't want to publish or sign any modules by default.

0 commit comments

Comments
 (0)