Skip to content

Commit a430038

Browse files
committed
HBX-3128: Avoid use of Maven invoker plugin while performing functional testing (#5513)
- Reorganize 'pom.xml' file - Reorganize test class ExamplesTestIT - Add the 'hbm2java/jpa-default' example - Remove erroneous line from '5-minute-tutorial/README.md' - Add a test for jpa-default and reorganize test class - Add the 'hbm2java/no-annotations' example - Add a test for no-annotations and reorganize test class - Add the 'hbm2java/no-generics' example - Add a test for no-generics - Add the 'hbm2java/use-generics' example - Add a test for use-generics - Make sure database is correctly created - Add assertion for the amount of generated files - Modify some utility methods to accept file name parameter - Add the 'hbm2java/template-path' example - Add a test for template-path - Add the 'hbm2java/output-dir' example - Add a test for 'hbm2java/output-dir' Signed-off-by: Koen Aers <[email protected]>
1 parent a4d4f06 commit a430038

File tree

22 files changed

+767
-38
lines changed

22 files changed

+767
-38
lines changed

maven/docs/examples/5-minute-tutorial/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ To run this example:
1818
- Have [H2 Sakila database](https://github.com/hibernate/sakila-h2) running
1919
- Issue one of the following commands from a command-line window opened in this folder:
2020
- `mvn generate-sources -Dh2.version=${h2.version} -Dproject.version=${hibernate.version}`
21-
- `mvn hbm2java -Dh2.version=${h2.version} -Dproject.version=${hibernate.version}`
2221

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!--
2+
~ Copyright 2004 - 2025 Red Hat, Inc.
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" basis,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
To run this example:
17+
- Have [Apache Maven](https://maven.apache.org) installed
18+
- Have [H2 Sakila database](https://github.com/hibernate/sakila-h2) running
19+
- Issue the following commands from a command-line window opened in this folder:
20+
`mvn generate-sources -Dh2.version=${h2.version} -Dhibernate.version=${hibernate.version}`
21+
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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>hbm2java-no-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>${hibernate.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+
<configuration>
50+
<ejb3>true</ejb3>
51+
</configuration>
52+
</plugin>
53+
</plugins>
54+
</build>
55+
56+
</project>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
############################################################################
2+
# Hibernate Tools, Tooling for your Hibernate Projects #
3+
# #
4+
# Copyright 2004-2025 Red Hat, Inc. #
5+
# #
6+
# Licensed under the Apache License, Version 2.0 (the "License"); #
7+
# you may not use this file except in compliance with the License. #
8+
# You may obtain a copy of the License at #
9+
# #
10+
# http://www.apache.org/licenses/LICENSE-2.0 #
11+
# #
12+
# Unless required by applicable law or agreed to in writing, software #
13+
# distributed under the License is distributed on an "AS IS" basis, #
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
15+
# See the License for the specific language governing permissions and #
16+
# limitations under the License. #
17+
############################################################################
18+
hibernate.connection.driver_class=org.h2.Driver
19+
hibernate.connection.url=jdbc:h2:tcp://localhost/./sakila
20+
hibernate.connection.username=sa
21+
hibernate.default_catalog=SAKILA
22+
hibernate.default_schema=PUBLIC
23+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!--
2+
~ Copyright 2004 - 2025 Red Hat, Inc.
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" basis,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
To run this example:
17+
- Have [Apache Maven](https://maven.apache.org) installed
18+
- Have [H2 Sakila database](https://github.com/hibernate/sakila-h2) running
19+
- Issue the following commands from a command-line window opened in this folder:
20+
`mvn generate-sources -Dh2.version=${h2.version} -Dhibernate.version=${hibernate.version}`
21+
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>hbm2java-no-generics</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>${hibernate.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>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
############################################################################
2+
# Hibernate Tools, Tooling for your Hibernate Projects #
3+
# #
4+
# Copyright 2004-2025 Red Hat, Inc. #
5+
# #
6+
# Licensed under the Apache License, Version 2.0 (the "License"); #
7+
# you may not use this file except in compliance with the License. #
8+
# You may obtain a copy of the License at #
9+
# #
10+
# http://www.apache.org/licenses/LICENSE-2.0 #
11+
# #
12+
# Unless required by applicable law or agreed to in writing, software #
13+
# distributed under the License is distributed on an "AS IS" basis, #
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
15+
# See the License for the specific language governing permissions and #
16+
# limitations under the License. #
17+
############################################################################
18+
hibernate.connection.driver_class=org.h2.Driver
19+
hibernate.connection.url=jdbc:h2:tcp://localhost/./sakila
20+
hibernate.connection.username=sa
21+
hibernate.default_catalog=SAKILA
22+
hibernate.default_schema=PUBLIC
23+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!--
2+
~ Copyright 2004 - 2025 Red Hat, Inc.
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" basis,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
To run this example:
17+
- Have [Apache Maven](https://maven.apache.org) installed
18+
- Have [H2 Sakila database](https://github.com/hibernate/sakila-h2) running
19+
- Issue the following commands from a command-line window opened in this folder:
20+
`mvn generate-sources -Dh2.version=${h2.version} -Dhibernate.version=${hibernate.version}`
21+
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>hbm2java-no-jpa-default</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>${hibernate.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>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
############################################################################
2+
# Hibernate Tools, Tooling for your Hibernate Projects #
3+
# #
4+
# Copyright 2004-2025 Red Hat, Inc. #
5+
# #
6+
# Licensed under the Apache License, Version 2.0 (the "License"); #
7+
# you may not use this file except in compliance with the License. #
8+
# You may obtain a copy of the License at #
9+
# #
10+
# http://www.apache.org/licenses/LICENSE-2.0 #
11+
# #
12+
# Unless required by applicable law or agreed to in writing, software #
13+
# distributed under the License is distributed on an "AS IS" basis, #
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
15+
# See the License for the specific language governing permissions and #
16+
# limitations under the License. #
17+
############################################################################
18+
hibernate.connection.driver_class=org.h2.Driver
19+
hibernate.connection.url=jdbc:h2:tcp://localhost/./sakila
20+
hibernate.connection.username=sa
21+
hibernate.default_catalog=SAKILA
22+
hibernate.default_schema=PUBLIC
23+

0 commit comments

Comments
 (0)