Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,7 @@ public void execute() throws MojoFailureException {
Thread.currentThread().setContextClassLoader(createExporterClassLoader(original));
getLog().info("Starting " + this.getClass().getSimpleName() + "...");
RevengStrategy strategy = setupReverseEngineeringStrategy();
if (propertyFile.exists()) {
executeExporter(createJdbcDescriptor(strategy, loadPropertiesFile()));
} else {
getLog().info("Property file '" + propertyFile + "' cannot be found, aborting...");
}
executeExporter(createJdbcDescriptor(strategy, loadPropertiesFile()));
getLog().info("Finished " + this.getClass().getSimpleName() + "!");
} finally {
Thread.currentThread().setContextClassLoader(original);
Expand Down Expand Up @@ -134,8 +130,10 @@ private Properties loadPropertiesFile() throws MojoFailureException {
result.load(is);
return result;
} catch (FileNotFoundException e) {
getLog().error("Property file '" + propertyFile + "' cannot be found, aborting...");
throw new MojoFailureException(propertyFile + " not found.", e);
} catch (IOException e) {
getLog().error("Property file '" + propertyFile + "' cannot be loaded, aborting...");
throw new MojoFailureException("Problem while loading " + propertyFile, e);
}
}
Expand Down
12 changes: 9 additions & 3 deletions test/maven/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<settingsFile>src/it/settings.xml</settingsFile>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<postBuildHookScript>verify</postBuildHookScript>
<goal>install</goal>
<goal>generate-sources</goal>
</configuration>
<executions>
<execution>
Expand All @@ -56,7 +55,14 @@
</goals>
</execution>
</executions>
</plugin>
<dependencies>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

Expand Down
19 changes: 0 additions & 19 deletions test/maven/src/it/generateHbm/invoker.properties

This file was deleted.

26 changes: 8 additions & 18 deletions test/maven/src/it/generateHbm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@
<artifactId>generateHbm</artifactId>
<version>0.0.1-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<java.version>1.8</java.version>
<h2.version>1.4.195</h2.version>
</properties>
<dependencies>
<dependency>
<!-- DB Driver of your choice -->
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>@h2.version@</version>
</dependency>
</dependencies>

<build>
<plugins>
Expand All @@ -50,17 +51,6 @@
</configuration>
</execution>
</executions>
<configuration>
<revengFile>${project.basedir}/src/main/resources/hibernate.reveng.xml</revengFile>
</configuration>
<dependencies>
<dependency>
<!-- DB Driver of your choice -->
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.io.*;

File file = new File(basedir, "target/generated-sources/Person.hbm.xml");
if (!file.isFile()) {
throw new FileNotFoundException("Could not find generated HBM file: " + file);
Expand Down
26 changes: 26 additions & 0 deletions test/maven/src/it/generateHbm/prebuild.bsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Hibernate Tools, Tooling for your Hibernate Projects
*
* Copyright 2018-2025 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.sql.DriverManager;
import java.sql.Connection;

String JDBC_CONNECTION = "jdbc:h2:" + basedir + "/test";
String CREATE_PERSON_TABLE = "create table PERSON (ID int not null, NAME varchar(20), primary key (ID))";

Connection connection = DriverManager.getConnection(JDBC_CONNECTION);
connection.createStatement().execute(CREATE_PERSON_TABLE);
connection.close();
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
# See the License for the specific language governing permissions and #
# limitations under the License. #
############################################################################
hibernate.dialect=org.hibernate.dialect.H2Dialect
hibernate.connection.driver_class=org.h2.Driver
hibernate.connection.url=jdbc:h2:./test;DB_CLOSE_ON_EXIT=FALSE
hibernate.connection.username=sa
hibernate.connection.password=
hibernate.connection.pool_size=1
hibernate.show_sql=true
hibernate.connection.url=jdbc:h2:./test
hibernate.default_catalog=TEST
hibernate.default_schema=PUBLIC

This file was deleted.

Binary file removed test/maven/src/it/generateHbm/test.mv.db
Binary file not shown.
19 changes: 0 additions & 19 deletions test/maven/src/it/hbm2dao/invoker.properties

This file was deleted.

26 changes: 8 additions & 18 deletions test/maven/src/it/hbm2dao/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@
<artifactId>hbm2dao</artifactId>
<version>0.0.1-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<java.version>1.8</java.version>
<h2.version>1.4.195</h2.version>
</properties>
<dependencies>
<dependency>
<!-- DB Driver of your choice -->
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>@h2.version@</version>
</dependency>
</dependencies>

<build>
<plugins>
Expand All @@ -49,17 +50,6 @@
</configuration>
</execution>
</executions>
<configuration>
<revengFile>${project.basedir}/src/main/resources/hibernate.reveng.xml</revengFile>
</configuration>
<dependencies>
<dependency>
<!-- DB Driver of your choice -->
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.io.*;

File dao = new File(basedir, "target/generated-sources/PersonHome.java");
if (!dao.isFile()) {
throw new FileNotFoundException("Could not find generated JPA DAO: " + dao);
Expand Down
26 changes: 26 additions & 0 deletions test/maven/src/it/hbm2dao/prebuild.bsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Hibernate Tools, Tooling for your Hibernate Projects
*
* Copyright 2018-2025 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.sql.DriverManager;
import java.sql.Connection;

String JDBC_CONNECTION = "jdbc:h2:" + basedir + "/test";
String CREATE_PERSON_TABLE = "create table PERSON (ID int not null, NAME varchar(20), primary key (ID))";

Connection connection = DriverManager.getConnection(JDBC_CONNECTION);
connection.createStatement().execute(CREATE_PERSON_TABLE);
connection.close();
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
# See the License for the specific language governing permissions and #
# limitations under the License. #
############################################################################
hibernate.dialect=org.hibernate.dialect.H2Dialect
hibernate.connection.driver_class=org.h2.Driver
hibernate.connection.url=jdbc:h2:./test;DB_CLOSE_ON_EXIT=FALSE
hibernate.connection.username=sa
hibernate.connection.password=
hibernate.connection.pool_size=1
hibernate.show_sql=true
hibernate.connection.url=jdbc:h2:./test
hibernate.default_catalog=TEST
hibernate.default_schema=PUBLIC
26 changes: 0 additions & 26 deletions test/maven/src/it/hbm2dao/src/main/resources/hibernate.reveng.xml

This file was deleted.

Binary file removed test/maven/src/it/hbm2dao/test.mv.db
Binary file not shown.
19 changes: 0 additions & 19 deletions test/maven/src/it/hbm2ddl/invoker.properties

This file was deleted.

25 changes: 7 additions & 18 deletions test/maven/src/it/hbm2ddl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
<artifactId>hbm2ddl</artifactId>
<version>0.0.1-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<java.version>1.8</java.version>
<h2.version>1.4.195</h2.version>
</properties>
<dependencies>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>@h2.version@</version>
</dependency>
</dependencies>

<build>
<plugins>
Expand All @@ -49,17 +49,6 @@
</configuration>
</execution>
</executions>
<configuration>
<revengFile>${project.basedir}/src/main/resources/hibernate.reveng.xml</revengFile>
</configuration>
<dependencies>
<dependency>
<!-- DB Driver of your choice -->
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Expand Down
Loading