From: Kai Moritz
Date: Sun, 26 Oct 2025 11:52:36 +0000 (+0100)
Subject: Moved version `2.1.0` of the `hibernate-maven-plugin` to the refined path
X-Git-Url: https://juplo.de/gitweb/?a=commitdiff_plain;h=d6e5fb7e4890afa74d8ec6516c687cf4add913e8;p=website
Moved version `2.1.0` of the `hibernate-maven-plugin` to the refined path
- This version was never linked under the old path.
- Hence, it can be moved without penalty.
---
diff --git a/projects/hibernate-maven-plugin-2.1.0/apidocs/allclasses-frame.html b/projects/hibernate-maven-plugin-2.1.0/apidocs/allclasses-frame.html
deleted file mode 100644
index d491a69..0000000
--- a/projects/hibernate-maven-plugin-2.1.0/apidocs/allclasses-frame.html
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-All Classes (Hibernate Maven Plugin 2.1.0 API)
-
-
-
-
-
-
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
-
-
-
-
-
Package
-
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
-
-
Interfaces (italic)
-
Classes
-
Enums
-
Exceptions
-
Errors
-
Annotation Types
-
-
-
-
Class/Interface
-
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
-
-
Class inheritance diagram
-
Direct Subclasses
-
All Known Subinterfaces
-
All Known Implementing Classes
-
Class/interface declaration
-
Class/interface description
-
-
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
-
-
-
Field Detail
-
Constructor Detail
-
Method Detail
-
-
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
-
-
-
Annotation Type
-
Each annotation type has its own separate page with the following sections:
-
-
Annotation Type declaration
-
Annotation Type description
-
Required Element Summary
-
Optional Element Summary
-
Element Detail
-
-
-
-
Enum
-
Each enum has its own separate page with the following sections:
-
-
Enum declaration
-
Enum description
-
Enum Constant Summary
-
Enum Constant Detail
-
-
-
-
Use
-
Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
-
-
-
Tree (Class Hierarchy)
-
There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
-
-
When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
-
When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
-
-
-
-
Deprecated API
-
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
-
-
-
Index
-
The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
-
-
-
Prev/Next
-
These links take you to the next or previous class, interface, package, or related page.
-
-
-
Frames/No Frames
-
These links show and hide the HTML frames. All pages are available with or without frames.
-
-
-
All Classes
-
The All Classes link shows all classes and interfaces except non-static nested types.
-
-
-
Serialized Form
-
Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
- The most simple way to configure the plugin is, to put all the
- hibernate-configuration in a hibernate.properties- or
- a hibernate.cfg.xml-file on your classpath or in the
- persistence.xml-file of your JPA-configuration, just
- like you would do, if you are not using the
- hibernate-maven-plugin.
-
-
-
- Doing so, the only additionally configuration needed, to activat the plugin
- is the following entry in the plugins-section of your pom.xml:
-
- A correspondin goal for the command update is missing in this
- version, but we are planning to implement it in near feature.
-
-
-
- In order to let this configuration work, your configuration file must
- contain a complete valid configuration for the database, that you want
- to use.
- A simple example hibernate.properties-file may look like this:
-
- But be aware, that using this configuration-approach the database-url,
- that is build in the application is the same that is used while testing,
- where the database is droped and recreated by the plugin.
- Because of that,
-
- you should never fire up this configuration on your production
- system, or your database might be erased!
-
-
-
-
- A better approach is, to specify a different url for testing like in the
- following snippet:
-
- Configuration properties, that are set in the configuration-section
- of the plugin-configuration cannnot be overwritten elsewere (for details
- see Configuration-Method-Precedence).
- You never can overwrite them by accident when specifying a property on
- the commandline or in your settings.xml.
-
-
-
-
Configuration through maven-properties
-
-
- Alternatively, it is possible, to configure the plugin via maven-properties.
- Each relevant configuration-option has a corresponding maven-property
- (for a full list see the Documentation of the goal create).
- These are named after the
- Hibernate JDBC Properties:
-
-
-
-
-
hibernate.connection.driver_class
-
-
hibernate.dialect
-
-
hibernate.connection.url
-
-
hibernate.connection.username
-
-
hibernate.connection.password
-
-
-
- So, instead of writing the hibernate-configuration in the properties-file,
- like above, you could put it in the properties-section of your
- pom.xml.
-
-
-
- Thogether with the plugin-definition from above, the following would
- be a complete configuration (again, the database-url was overwritten in
- the plugin-configuration, to be sure to have a separate database for
- testing):
-
- This way, you can reuse the same properties to provide a
- default-configurationthe, that is build into your application, and
- overwrite the database-url, that is used during testing to prevent
- accidential drops of your production database.
-
-
-
-
Configuration through the plugin-configuration
-
-
- A third way for configuring the plugin is the plugin-configuration.
- The relevant configuration-parameters are:
-
-
-
-
-
driver
-
-
dialect
-
-
url
-
-
username
-
-
password
-
-
-
- The equivalent of the configuration from the last section would look
- like this:
-
- The parameter hibernateProperties (name of the hibernate-properties-file
- to use, defaults to hibernate.properties) can only be configured through
- this approach.
-
- If you are in doubt about where a configuration-value comes from, run
- maven with the debug-output enabled: mvn -X hibernate:create
- and be aware, that maven-properties can be overwitten on the command-line,
- in your ~/.m2/settings.xml and in a profile.
-
-
-
- The plugin-configuration comes last and overwrites everything else.
- That way, you can be sure, that a configuration-value, that is
- specified in the plugin-configuration will never be overwritten by any
- other configuration-method.
-
-
-
- If you need to overwrite plugin-configuration-values with
- maven-properties, you can use maven-properties in the plugin-configuration:
-
Specifies whether to automatically create also the database
-schema/catalog. Default value is: false. User property is: hibernate.hbm2dll.create_namespaces.
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Default value is: ;. User property is: hibernate.hbm2ddl.delimiter.
Excecute the generated SQL. If set to false, only the
-SQL-script is created and the database is not touched.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Default value is: true. User property is: hibernate.schema.execute.
Force the generation and (if configured) the execution of the
-SQL, even if no modified or newly added annotated classes where
-found and the configuration was not changed.
-
-
skip takes precedence over force.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Default value is: false. User property is: hibernate.schema.force.
Path to Hibernate configuration file (.cfg.xml). If this parameter
-is specified, the plugin will try to load configuration values from
-a file with the given path or a ressource on the classpath with the
-given name. If both fails, the execution of the plugin will fail.
-
-
If this parameter is not set the plugin will load configuration
-values from a ressource named hibernate.cfg.xml on the
-classpath, if it is present, but will not fail if there is no such
-ressource.
-
-
During ressource-lookup, the test-classpath takes
-precedence.
-
-
Settings in this file will overwrite settings in the properties
-file.
Path to a file or name of a ressource with hibernate properties. If
-this parameter is specified, the plugin will try to load
-configuration values from a file with the given path or a ressource
-on the classpath with the given name. If both fails, the execution
-of the plugin will fail.
-
-
If this parameter is not set the plugin will load configuration
-values from a ressource named hibernate.properties on
-the classpath, if it is present, but will not fail if there is no
-such ressource.
-
-
During ressource-lookup, the test-classpath takes
-precedence.
This parameter defaults to the maven build-output-directory for
-classes. Additionally, all dependencies are scanned for annotated
-classes.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Name of the persistence-unit. If this parameter is specified, the
-plugin will try to load configuration values from a
-persistence-unit with the specified name. If no such
-persistence-unit can be found, the plugin will throw an exception.
-
-
If this parameter is not set and there is only one
-persistence-unit available, that unit will be used automatically.
-But if this parameter is not set and there are multiple
-persistence-units available on, the class-path, the execution of
-the plugin will fail.
-
-
Settings in this file will overwrite settings in the properties
-or the configuration file.
Wether the project should be scanned for annotated-classes, or not
-
-
This parameter is intended to allow overwriting of the parameter
-exclude-unlisted-classes of a
-persistence-unit. If not specified, it defaults to
-true
Dependency-Scopes, that should be scanned for annotated classes.
-
-
By default, only dependencies in the scope compile
-are scanned for annotated classes. Multiple scopes can be seperated
-by white space or commas.
-
-
If you do not want any dependencies to be scanned for annotated
-classes, set this parameter to none.
-
-
The plugin does not scan for annotated classes in transitive
-dependencies. If some of your annotated classes are hidden in a
-transitive dependency, you can simply add that dependency
-explicitly.
Default value is: compile. User property is: hibernate.schema.scan.dependencies.
Whether to scan the test-branch of the project for annotated
-classes, or not.
-
-
If this parameter is set to true the test-classes
-of the artifact will be scanned for hibernate-annotated classes
-additionally.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Default value is: false. User property is: hibernate.schema.scan.test_classes.
A skipped execution is signaled via the maven-property
-${hibernate.schema.skipped}.
-
-
The execution is skipped automatically, if no modified or newly
-added annotated classes are found and the dialect was not
-changed.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Default value is: ${maven.test.skip}. User property is: hibernate.schema.skip.
This parameter defaults to the maven build-output-directory for
-test-classes.
-
-
This parameter is only used, when scanTestClasses
-is set to true!
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
User property is: project.build.testOutputDirectory.
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Excecute the generated SQL. If set to false, only the
-SQL-script is created and the database is not touched.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Force the generation and (if configured) the execution of the
-SQL, even if no modified or newly added annotated classes where
-found and the configuration was not changed.
-
-
skip takes precedence over force.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Path to Hibernate configuration file (.cfg.xml). If this parameter
-is specified, the plugin will try to load configuration values from
-a file with the given path or a ressource on the classpath with the
-given name. If both fails, the execution of the plugin will fail.
-
-
If this parameter is not set the plugin will load configuration
-values from a ressource named hibernate.cfg.xml on the
-classpath, if it is present, but will not fail if there is no such
-ressource.
-
-
During ressource-lookup, the test-classpath takes
-precedence.
-
-
Settings in this file will overwrite settings in the properties
-file.
Path to a file or name of a ressource with hibernate properties. If
-this parameter is specified, the plugin will try to load
-configuration values from a file with the given path or a ressource
-on the classpath with the given name. If both fails, the execution
-of the plugin will fail.
-
-
If this parameter is not set the plugin will load configuration
-values from a ressource named hibernate.properties on
-the classpath, if it is present, but will not fail if there is no
-such ressource.
-
-
During ressource-lookup, the test-classpath takes
-precedence.
This parameter defaults to the maven build-output-directory for
-classes. Additionally, all dependencies are scanned for annotated
-classes.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Name of the persistence-unit. If this parameter is specified, the
-plugin will try to load configuration values from a
-persistence-unit with the specified name. If no such
-persistence-unit can be found, the plugin will throw an exception.
-
-
If this parameter is not set and there is only one
-persistence-unit available, that unit will be used automatically.
-But if this parameter is not set and there are multiple
-persistence-units available on, the class-path, the execution of
-the plugin will fail.
-
-
Settings in this file will overwrite settings in the properties
-or the configuration file.
Wether the project should be scanned for annotated-classes, or not
-
-
This parameter is intended to allow overwriting of the parameter
-exclude-unlisted-classes of a
-persistence-unit. If not specified, it defaults to
-true
Dependency-Scopes, that should be scanned for annotated classes.
-
-
By default, only dependencies in the scope compile
-are scanned for annotated classes. Multiple scopes can be seperated
-by white space or commas.
-
-
If you do not want any dependencies to be scanned for annotated
-classes, set this parameter to none.
-
-
The plugin does not scan for annotated classes in transitive
-dependencies. If some of your annotated classes are hidden in a
-transitive dependency, you can simply add that dependency
-explicitly.
Whether to scan the test-branch of the project for annotated
-classes, or not.
-
-
If this parameter is set to true the test-classes
-of the artifact will be scanned for hibernate-annotated classes
-additionally.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
A skipped execution is signaled via the maven-property
-${hibernate.schema.skipped}.
-
-
The execution is skipped automatically, if no modified or newly
-added annotated classes are found and the dialect was not
-changed.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
This parameter defaults to the maven build-output-directory for
-test-classes.
-
-
This parameter is only used, when scanTestClasses
-is set to true!
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
- If you are new to hibernate-maven-plugin, in many cases, the
- Configuration-Method-Precedence
- may be the source of configuration errors.
- To solve this problem, you should run maven with the debugging output
- enabled.
- For example, by executing:
-
-
-
-
-mvn -X compile hibernate:create
-
-
- (The compile might be necessary, because hibernate-maven-plugin
- has to scan the compiled classes for annotations!)
-
-
-
- Unlike the majority of the maven-plugins, hibernate-maven-plugin was
- designed to give a good many hints, when debugging is enabled.
- Because, if you do not know, what went wrong, you can't fix it!
-
-
-
- But be warned:hibernate-maven-plugin tends to be very chatty ;)
-
Description: Maven is a software build management and
- comprehension tool. Based on the concept of a project object model:
- builds, dependency management, documentation creation, site
- publication, and distribution publication are all controlled from
- the declarative file. Maven can be extended by plugins to utilise a
- number of other development tools for reporting or the build
- process.
Description: Guava is a suite of core and expanded libraries that include
- utility classes, google's collections, io classes, and much
- much more.
-
- Guava has only one code dependency - javax.annotation,
- per the JSR-305 spec.
Description: Plexus Component "Java 5" Annotations, to describe plexus components properties in java sources with
- standard annotations instead of javadoc annotations.
Description: A framework for constructing recognizers, compilers,
- and translators from grammatical descriptions containing
- Java, C#, C++, or Python actions.
Specifies whether to automatically create also the database
-schema/catalog. Default value is: false. User property is: hibernate.hbm2dll.create_namespaces.
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Default value is: ;. User property is: hibernate.hbm2ddl.delimiter.
Excecute the generated SQL. If set to false, only the
-SQL-script is created and the database is not touched.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Default value is: true. User property is: hibernate.schema.execute.
Force the generation and (if configured) the execution of the
-SQL, even if no modified or newly added annotated classes where
-found and the configuration was not changed.
-
-
skip takes precedence over force.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Default value is: false. User property is: hibernate.schema.force.
Path to Hibernate configuration file (.cfg.xml). If this parameter
-is specified, the plugin will try to load configuration values from
-a file with the given path or a ressource on the classpath with the
-given name. If both fails, the execution of the plugin will fail.
-
-
If this parameter is not set the plugin will load configuration
-values from a ressource named hibernate.cfg.xml on the
-classpath, if it is present, but will not fail if there is no such
-ressource.
-
-
During ressource-lookup, the test-classpath takes
-precedence.
-
-
Settings in this file will overwrite settings in the properties
-file.
Path to a file or name of a ressource with hibernate properties. If
-this parameter is specified, the plugin will try to load
-configuration values from a file with the given path or a ressource
-on the classpath with the given name. If both fails, the execution
-of the plugin will fail.
-
-
If this parameter is not set the plugin will load configuration
-values from a ressource named hibernate.properties on
-the classpath, if it is present, but will not fail if there is no
-such ressource.
-
-
During ressource-lookup, the test-classpath takes
-precedence.
This parameter defaults to the maven build-output-directory for
-classes. Additionally, all dependencies are scanned for annotated
-classes.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Name of the persistence-unit. If this parameter is specified, the
-plugin will try to load configuration values from a
-persistence-unit with the specified name. If no such
-persistence-unit can be found, the plugin will throw an exception.
-
-
If this parameter is not set and there is only one
-persistence-unit available, that unit will be used automatically.
-But if this parameter is not set and there are multiple
-persistence-units available on, the class-path, the execution of
-the plugin will fail.
-
-
Settings in this file will overwrite settings in the properties
-or the configuration file.
Wether the project should be scanned for annotated-classes, or not
-
-
This parameter is intended to allow overwriting of the parameter
-exclude-unlisted-classes of a
-persistence-unit. If not specified, it defaults to
-true
Dependency-Scopes, that should be scanned for annotated classes.
-
-
By default, only dependencies in the scope compile
-are scanned for annotated classes. Multiple scopes can be seperated
-by white space or commas.
-
-
If you do not want any dependencies to be scanned for annotated
-classes, set this parameter to none.
-
-
The plugin does not scan for annotated classes in transitive
-dependencies. If some of your annotated classes are hidden in a
-transitive dependency, you can simply add that dependency
-explicitly.
Default value is: compile. User property is: hibernate.schema.scan.dependencies.
Whether to scan the test-branch of the project for annotated
-classes, or not.
-
-
If this parameter is set to true the test-classes
-of the artifact will be scanned for hibernate-annotated classes
-additionally.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Default value is: false. User property is: hibernate.schema.scan.test_classes.
A skipped execution is signaled via the maven-property
-${hibernate.schema.skipped}.
-
-
The execution is skipped automatically, if no modified or newly
-added annotated classes are found and the dialect was not
-changed.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Default value is: ${maven.test.skip}. User property is: hibernate.schema.skip.
This parameter defaults to the maven build-output-directory for
-test-classes.
-
-
This parameter is only used, when scanTestClasses
-is set to true!
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
User property is: project.build.testOutputDirectory.
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Excecute the generated SQL. If set to false, only the
-SQL-script is created and the database is not touched.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Force the generation and (if configured) the execution of the
-SQL, even if no modified or newly added annotated classes where
-found and the configuration was not changed.
-
-
skip takes precedence over force.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Path to Hibernate configuration file (.cfg.xml). If this parameter
-is specified, the plugin will try to load configuration values from
-a file with the given path or a ressource on the classpath with the
-given name. If both fails, the execution of the plugin will fail.
-
-
If this parameter is not set the plugin will load configuration
-values from a ressource named hibernate.cfg.xml on the
-classpath, if it is present, but will not fail if there is no such
-ressource.
-
-
During ressource-lookup, the test-classpath takes
-precedence.
-
-
Settings in this file will overwrite settings in the properties
-file.
Path to a file or name of a ressource with hibernate properties. If
-this parameter is specified, the plugin will try to load
-configuration values from a file with the given path or a ressource
-on the classpath with the given name. If both fails, the execution
-of the plugin will fail.
-
-
If this parameter is not set the plugin will load configuration
-values from a ressource named hibernate.properties on
-the classpath, if it is present, but will not fail if there is no
-such ressource.
-
-
During ressource-lookup, the test-classpath takes
-precedence.
This parameter defaults to the maven build-output-directory for
-classes. Additionally, all dependencies are scanned for annotated
-classes.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Name of the persistence-unit. If this parameter is specified, the
-plugin will try to load configuration values from a
-persistence-unit with the specified name. If no such
-persistence-unit can be found, the plugin will throw an exception.
-
-
If this parameter is not set and there is only one
-persistence-unit available, that unit will be used automatically.
-But if this parameter is not set and there are multiple
-persistence-units available on, the class-path, the execution of
-the plugin will fail.
-
-
Settings in this file will overwrite settings in the properties
-or the configuration file.
Wether the project should be scanned for annotated-classes, or not
-
-
This parameter is intended to allow overwriting of the parameter
-exclude-unlisted-classes of a
-persistence-unit. If not specified, it defaults to
-true
Dependency-Scopes, that should be scanned for annotated classes.
-
-
By default, only dependencies in the scope compile
-are scanned for annotated classes. Multiple scopes can be seperated
-by white space or commas.
-
-
If you do not want any dependencies to be scanned for annotated
-classes, set this parameter to none.
-
-
The plugin does not scan for annotated classes in transitive
-dependencies. If some of your annotated classes are hidden in a
-transitive dependency, you can simply add that dependency
-explicitly.
Whether to scan the test-branch of the project for annotated
-classes, or not.
-
-
If this parameter is set to true the test-classes
-of the artifact will be scanned for hibernate-annotated classes
-additionally.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
A skipped execution is signaled via the maven-property
-${hibernate.schema.skipped}.
-
-
The execution is skipped automatically, if no modified or newly
-added annotated classes are found and the dialect was not
-changed.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
This parameter defaults to the maven build-output-directory for
-test-classes.
-
-
This parameter is only used, when scanTestClasses
-is set to true!
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
- The hibernate-maven-plugin computes MD5-sums for all found annotated
- classes and stores them together with the generated schema.
- If no classes were changed or added and the dialect wasn't changed too, it
- automatically skips the configured SQL-generation — and more
- important in this respect — the execution of the generated SQL,
- to speed up the development cycle.
-
-
-
- The plugin signals, that the execution was skipped by setting the maven
- property ${hibernate.schema.skipped} to true.
- This may be helpful, because other plugins like
- dbunit-plugin
- may fail, when the execution is skipped.
-
-
-
- If you need the hibernate-maven-plugin to never skip execution automatically,
- you can force it to do so, if you set the parameter force to
- true:
-
A simple plugin for generating a database-schema from Hibernate-Mappings
-
-
- The hibernate-maven-plugin is a plugin for generating a database-schema
- from your Hibernate-Mappings and create or update your database
- accordingly.
- Its main usage is to automatically create and populate a test-database
- for unit-tests in cooperation with the
- dbunit-maven-plugin.
-
-
-
- The plugin was designed with three main goals in mind:
-
-
-
-
-
It should be easy to use.
-
-
It should be maximal unlikely, to erase a producation-database by accident.
-
-
It should not slow down the development cycle.
-
-
-
- To achieve the first goal, the convention-over-configuration paradigma
- was applied and the plugin was stuffed with usefull logging-messages.
- So, if in doubt, just turn on the debugging output with the mvn -X ....
-
-
-
- To achieve the second goal, the precedence in which the configuration
- locations are consulted was layouted in a way that makes it possible, to
- prevent overwrites of the wrong database by accident.
-
-
-
- Last but not least, in order to not slow down the development cycle, the
- hibernate-maven-plugin only executes the generated SQL, if the mapping
- or the configuration has changed (or if you force it to do so).
-
- See Configuration Examples for Usage-Explanations
- and simple examples of how to use this plugin.
-
-
-
- See hibernate:create,
- See hibernate:drop and
- Plugin Documentation for the full
- autogenerated documentation. These are mostly configuration-options
- from the Hibernate-Tooling, that does the work in the background.
-
Typically the licenses listed for the project are that of the project itself, and not of dependencies.
-
-
Project Licenses
-
-
The Apache Software License, Version 2.0
-
A business-friendly OSS license
-
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- 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.
-
- hibernate-maven-plugin by default scans dependencies in the scope
- compile. You can configure it to scan dependencies in other
- scopes as well. But it scans only direct dependencies. Transitive
- dependencies are not scanned for annotated classes. If some of your
- annotated classes are hidden in a transitive dependency, you can simply
- add that dependency explicitly.
-
-
-
-
hibernate-maven-plugin always needs a database-connection
-
-
- The default-configuration executes the created SQL.
- Therefore, it needs a valid database-connection and fails, if none is
- available.
- If you do not need the generated SQL to be executed automatically,
- you can set the property hibernate.schema.execute to
- false.
- This can be achieved with the command-line parameter
- -Dhibernate.schema.execute=false or with the following
- configuration:
-
- But even when no database is to be created, hibernate always needs to know
- the dialect. Hence, the plugin will still fail, if this parameter is also
- missing!
-
-
-
-
Dependency for driver-class XYZ is missing
-
-
- One regular problem is the scope of the jdbc-driver-dependency.
- It is very unlikely, that this dependency is needed at compile-time.
- So a tidy maven-developer would usually scope it for runtime.
-
-
-
- But this will break the execution of the hibernate-maven-plugin.
- Since it will not be able to see the needed dependency, it will fail with
- an error-message like:
-
-
-
-
-[INFO] Gathered hibernate-configuration (turn on debugging for details):
-[INFO] hibernate.connection.username = sa
-[INFO] hibernate.connection.password =
-[INFO] hibernate.dialect = org.hibernate.dialect.H2Dialect
-[INFO] hibernate.connection.url = jdbc:h2:file:./db
-[INFO] hibernate.hbm2dll.create_namespaces = false
-[INFO] hibernate.connection.driver_class = org.h2.Driver
-[INFO] hibernate.format_sql = true
-[INFO] HHH000412: Hibernate Core {5.0.2.Final}
-[INFO] HHH000206: hibernate.properties not found
-[INFO] HHH000021: Bytecode provider name : javassist
-[INFO] Adding /home/kai/project/target/classes to the list of roots to scan...
-[INFO] Adding dependencies from scope compile to the list of roots to scan
-[INFO] Adding dependencies from scope org.hibernate:hibernate-core:jar:4.3.0.Final to the list of roots to scan
-[INFO] Adding annotated resource: de.juplo.tests.SimplestMavenHib4Test
-[INFO] ------------------------------------------------------------------------
-[INFO] BUILD FAILURE
-[INFO] ------------------------------------------------------------------------
-[INFO] Total time: 1.760s
-[INFO] Finished at: Mon Mar 07 19:06:54 CET 2016
-[INFO] Final Memory: 11M/215M
-[INFO] ------------------------------------------------------------------------
-[ERROR] Failed to execute goal de.juplo:hibernate-maven-plugin:2.1.0:drop (default) on project hibernate4-properties-test: Could not open the JDBC-connection: Unable to load class [org.h2.Driver]: Could not load requested class : org.h2.Driver -> [Help 1]
-[ERROR]
-[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
-[ERROR] Re-run Maven using the -X switch to enable full debug logging.
-[ERROR]
-[ERROR] For more information about the errors and possible solutions, please read the following articles:
-[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
-
-
- A quick workaround for this error would be, to delete the runtime-constraint
- for the jdbc-driver-dependency.
-
-
-
- A much cleaner way is, to (additionally) ad the dependency, to the
- plugin-definition:
-
- This is also the best way, if you use a different jdbc-driver for
- testing, than in production.
- Because otherwise, this dependency will unnecessarily bloat the
- runtime-dependencies of your project.
-
-
-
-
DBUnit fails after execution of hibernate was skipped because nothing has changed
-
-
- If hibernate-maven-plugin skips its excecution, this may lead to errors in
- other plugins.
- For example, when importing sample-data in the automatically created database
- with the help of the dbunit-plugin,
- the CLEAN_INSERT-operation may fail because of foreign-key-constraints,
- if the database was not recreated, because the hibernate-maven-plugin has
- skipped its excecution.
-
-
-
- A quick fix to this problem is, to force
- hibernate-maven-plugin to generate and execute the SQL every time it is running.
- But to recreate the database on every testrun may noticeable slow down your
- development cycle, if you have to wait for slow IO.
-
-
-
- To circumvent this problem, hibernate-maven-plugin signals a skipped
- excecution by setting the maven property ${hibernate.schema.skipped} to
- true.
- You can configure other plugins to react on this signal.
- For example, the dbunit-plugin can be configured to skip its excecution, if
- hibernate-maven-plugin was skipped like this:
-
The database will not be recreated after a manual drop/clean
-
-
- If one manually drops the database or removes the hsqldb-files, it will not
- be recreated by the hibernate-maven-plugin, because it cannot detect, that
- the database needs to be recreated.
- This happens, because the plugin will not recreate the database if neither
- the configuration nor the annotated classes have changed, because an
- unnecessary drop-create-cycle might take a long time. The plugin will
- report that like this:
-
-
-
-
-[INFO] No modified annotated classes found and dialect unchanged.
-[INFO] Skipping schema generation!
-
-
- If one always uses mvn clean for cleanup, this will not happen.
- Otherwise the recreation must be forced:
-
The hibernate:create goal is not executed, when tests are skipped
-
-
- The hibernate-maven-plugin automatically skips its execution, when
- maven.test.skip is set to true. If you need it to be always
- executed, you can configure that explicitly like this:
-
I do not want my dependencies to be scanned for hibernate annotations
-
-
- If you do not want your dependencies to be scanned for hibernate annotations,
- you can pass -Dhibernate.schema.scan.dependencies=none to maven
- or set scanDependencies to none in the configuration
- of the plugin like this:
-
- If you are working under Windows and get the error-message
- No annotated classes found in directory C:\projects\X Y Z\path-to-project\target\classes,
- but you are really sure, that there are annotated classes in that
- directory, you are expiriencing a bug, in the scannotation-library, that
- was closed in version 1.1.0 of the hibernate-maven-plugin.
-
-
-
-
- You should consider to upgrade to the latest version of the plugin.
-
-
-
-
-
If two goals are specified, the second one is always skipped
-
-
- If you specify two goals, for example drop and
- create, each goal has to be specified in its own
- execution, so that you can specify two different
- output-files for the two goals.
- Otherwise, both goals will use the same output-file and the goal, that
- is run second, will always skip, becaus it will find, that the output
- file already exists and conclude, that its work was already done in a
- prior run.
-
This document provides an overview of the various documents and links that are part of this project's general information. All of this content is automatically generated by Maven on behalf of the project.
This document provides information on the members of this project. These are the individuals who have contributed to the project in one form or another.
- In most use-cases, the hibernate-maven-plugin is used to create a
- test-database automatically. In this use-cases, it is very likely, that it
- will result in mistakes/errors, if the goal is executed, when the tests
- are skipped.
- For example, one might manually overwrite the database-url with the url of
- the production-database, in order to run other tests, like starting a
- local webserver with the
- jetty-maven-plugin.
- If the drop-goal would be executed in such a scenario, it might erase the
- hole production-database, which is not very desireable.
-
-
-
- Because of this, the configuration-parameter skip defaults to the value
- of the proptery maven.test.skip. This way, the execution of the
- hibernate-maven-plugin is skipped automatically, when the tests are
- skipped. Think of it as a build-in security-belt.
-
-
-
- If you do not like that, because you need the plugin to always,
- even if the tests are skipped you can configure that explicitly,
- by setting the configuration-parameter skip to false:
-
- Or, if you want the plugin to be executed by default and to be skipped
- if you say so, you can bind the value of the configuration-parameter
- skip to a custom property. For example:
-
- This way, the plugin would be skipped, if you set the property
- foo.bar to true. For example, if you specify -Dfoo.bar=true
- on the command-line.
-
A successful project requires many people to play many roles. Some members write code or documentation, while others are valuable as testers, submitting patches and suggestions.
-
The project team is comprised of Members and Contributors. Members have direct access to the source of a project and actively evolve the code-base. Contributors improve the project through submission of patches and suggestions to the Members. The number of Contributors to the project is unbounded. Get involved today. All contributions to the project are greatly appreciated.
-
-
Members
-
The following is a list of developers with commit privileges that have directly contributed to the project in one way or another.
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
-
-
-
-
-
Package
-
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
-
-
Interfaces (italic)
-
Classes
-
Enums
-
Exceptions
-
Errors
-
Annotation Types
-
-
-
-
Class/Interface
-
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
-
-
Class inheritance diagram
-
Direct Subclasses
-
All Known Subinterfaces
-
All Known Implementing Classes
-
Class/interface declaration
-
Class/interface description
-
-
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
-
-
-
Field Detail
-
Constructor Detail
-
Method Detail
-
-
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
-
-
-
Annotation Type
-
Each annotation type has its own separate page with the following sections:
-
-
Annotation Type declaration
-
Annotation Type description
-
Required Element Summary
-
Optional Element Summary
-
Element Detail
-
-
-
-
Enum
-
Each enum has its own separate page with the following sections:
-
-
Enum declaration
-
Enum description
-
Enum Constant Summary
-
Enum Constant Detail
-
-
-
-
Use
-
Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
-
-
-
Tree (Class Hierarchy)
-
There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
-
-
When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
-
When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
-
-
-
-
Deprecated API
-
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
-
-
-
Index
-
The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
-
-
-
Prev/Next
-
These links take you to the next or previous class, interface, package, or related page.
-
-
-
Frames/No Frames
-
These links show and hide the HTML frames. All pages are available with or without frames.
-
-
-
All Classes
-
The All Classes link shows all classes and interfaces except non-static nested types.
-
-
-
Serialized Form
-
Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
Specifies whether to automatically create also the database
-schema/catalog. Default value is: false. User property is: hibernate.hbm2dll.create_namespaces.
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Default value is: ;. User property is: hibernate.hbm2ddl.delimiter.
Excecute the generated SQL. If set to false, only the
-SQL-script is created and the database is not touched.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Default value is: true. User property is: hibernate.schema.execute.
Force the generation and (if configured) the execution of the
-SQL, even if no modified or newly added annotated classes where
-found and the configuration was not changed.
-
-
skip takes precedence over force.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Default value is: false. User property is: hibernate.schema.force.
Path to Hibernate configuration file (.cfg.xml). If this parameter
-is specified, the plugin will try to load configuration values from
-a file with the given path or a ressource on the classpath with the
-given name. If both fails, the execution of the plugin will fail.
-
-
If this parameter is not set the plugin will load configuration
-values from a ressource named hibernate.cfg.xml on the
-classpath, if it is present, but will not fail if there is no such
-ressource.
-
-
During ressource-lookup, the test-classpath takes
-precedence.
-
-
Settings in this file will overwrite settings in the properties
-file.
Path to a file or name of a ressource with hibernate properties. If
-this parameter is specified, the plugin will try to load
-configuration values from a file with the given path or a ressource
-on the classpath with the given name. If both fails, the execution
-of the plugin will fail.
-
-
If this parameter is not set the plugin will load configuration
-values from a ressource named hibernate.properties on
-the classpath, if it is present, but will not fail if there is no
-such ressource.
-
-
During ressource-lookup, the test-classpath takes
-precedence.
This parameter defaults to the maven build-output-directory for
-classes. Additionally, all dependencies are scanned for annotated
-classes.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Name of the persistence-unit. If this parameter is specified, the
-plugin will try to load configuration values from a
-persistence-unit with the specified name. If no such
-persistence-unit can be found, the plugin will throw an exception.
-
-
If this parameter is not set and there is only one
-persistence-unit available, that unit will be used automatically.
-But if this parameter is not set and there are multiple
-persistence-units available on, the class-path, the execution of
-the plugin will fail.
-
-
Settings in this file will overwrite settings in the properties
-or the configuration file.
Wether the project should be scanned for annotated-classes, or not
-
-
This parameter is intended to allow overwriting of the parameter
-exclude-unlisted-classes of a
-persistence-unit. If not specified, it defaults to
-true
Dependency-Scopes, that should be scanned for annotated classes.
-
-
By default, only dependencies in the scope compile
-are scanned for annotated classes. Multiple scopes can be seperated
-by white space or commas.
-
-
If you do not want any dependencies to be scanned for annotated
-classes, set this parameter to none.
-
-
The plugin does not scan for annotated classes in transitive
-dependencies. If some of your annotated classes are hidden in a
-transitive dependency, you can simply add that dependency
-explicitly.
Default value is: compile. User property is: hibernate.schema.scan.dependencies.
Whether to scan the test-branch of the project for annotated
-classes, or not.
-
-
If this parameter is set to true the test-classes
-of the artifact will be scanned for hibernate-annotated classes
-additionally.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Default value is: false. User property is: hibernate.schema.scan.test_classes.
A skipped execution is signaled via the maven-property
-${hibernate.schema.skipped}.
-
-
The execution is skipped automatically, if no modified or newly
-added annotated classes are found and the dialect was not
-changed.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Default value is: ${maven.test.skip}. User property is: hibernate.schema.skip.
This parameter defaults to the maven build-output-directory for
-test-classes.
-
-
This parameter is only used, when scanTestClasses
-is set to true!
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
User property is: project.build.testOutputDirectory.
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Excecute the generated SQL. If set to false, only the
-SQL-script is created and the database is not touched.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Force the generation and (if configured) the execution of the
-SQL, even if no modified or newly added annotated classes where
-found and the configuration was not changed.
-
-
skip takes precedence over force.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Path to Hibernate configuration file (.cfg.xml). If this parameter
-is specified, the plugin will try to load configuration values from
-a file with the given path or a ressource on the classpath with the
-given name. If both fails, the execution of the plugin will fail.
-
-
If this parameter is not set the plugin will load configuration
-values from a ressource named hibernate.cfg.xml on the
-classpath, if it is present, but will not fail if there is no such
-ressource.
-
-
During ressource-lookup, the test-classpath takes
-precedence.
-
-
Settings in this file will overwrite settings in the properties
-file.
Path to a file or name of a ressource with hibernate properties. If
-this parameter is specified, the plugin will try to load
-configuration values from a file with the given path or a ressource
-on the classpath with the given name. If both fails, the execution
-of the plugin will fail.
-
-
If this parameter is not set the plugin will load configuration
-values from a ressource named hibernate.properties on
-the classpath, if it is present, but will not fail if there is no
-such ressource.
-
-
During ressource-lookup, the test-classpath takes
-precedence.
This parameter defaults to the maven build-output-directory for
-classes. Additionally, all dependencies are scanned for annotated
-classes.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
Name of the persistence-unit. If this parameter is specified, the
-plugin will try to load configuration values from a
-persistence-unit with the specified name. If no such
-persistence-unit can be found, the plugin will throw an exception.
-
-
If this parameter is not set and there is only one
-persistence-unit available, that unit will be used automatically.
-But if this parameter is not set and there are multiple
-persistence-units available on, the class-path, the execution of
-the plugin will fail.
-
-
Settings in this file will overwrite settings in the properties
-or the configuration file.
Wether the project should be scanned for annotated-classes, or not
-
-
This parameter is intended to allow overwriting of the parameter
-exclude-unlisted-classes of a
-persistence-unit. If not specified, it defaults to
-true
Dependency-Scopes, that should be scanned for annotated classes.
-
-
By default, only dependencies in the scope compile
-are scanned for annotated classes. Multiple scopes can be seperated
-by white space or commas.
-
-
If you do not want any dependencies to be scanned for annotated
-classes, set this parameter to none.
-
-
The plugin does not scan for annotated classes in transitive
-dependencies. If some of your annotated classes are hidden in a
-transitive dependency, you can simply add that dependency
-explicitly.
Whether to scan the test-branch of the project for annotated
-classes, or not.
-
-
If this parameter is set to true the test-classes
-of the artifact will be scanned for hibernate-annotated classes
-additionally.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
A skipped execution is signaled via the maven-property
-${hibernate.schema.skipped}.
-
-
The execution is skipped automatically, if no modified or newly
-added annotated classes are found and the dialect was not
-changed.
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
This parameter defaults to the maven build-output-directory for
-test-classes.
-
-
This parameter is only used, when scanTestClasses
-is set to true!
-
-
Important: This configuration value can only be
-configured through the pom.xml, or by the definition
-of a system-property, because it is not known by Hibernate nor JPA
-and, hence, not picked up from their configuration!
-1package de.juplo.plugins.hibernate;
-2
-3/*
-4 * Copyright 2001-2005 The Apache Software Foundation.
-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
-19import java.util.Map;
-20import org.apache.maven.plugin.MojoExecutionException;
-21import org.apache.maven.plugin.MojoFailureException;
-22import org.hibernate.boot.spi.MetadataImplementor;
-23import org.hibernate.service.ServiceRegistry;
-24import org.hibernate.tool.schema.spi.ExecutionOptions;
-25import org.hibernate.tool.schema.spi.SchemaManagementTool;
-26import org.hibernate.tool.schema.spi.TargetDescriptor;
-27
-28
-29/**
-30 * Generate/Execute SQL to update the database-schema according to the
-31 * configured mappings.
-32 *
-33 * @goal update
-34 * @phase process-classes
-35 * @threadSafe
-36 * @requiresDependencyResolution runtime
-37 */
-38publicclassUpdateMojoextendsAbstractSchemaMojo
-39 {
-40/**
-41 * Output file.
-42 * <p>
-43 * If the specified filename is not absolut, the file will be created
-44 * relative to the project build directory
-45 * (<code>project.build.directory</code>).
-46 *
-47 * @parameter property="hibernate.schema.update" default-value="update.sql"
-48 * @since 1.0
-49 */
-50private String outputFile;
-51
-52
-53 @Override
-54publicfinalvoid execute()
-55throws
-56 MojoFailureException,
-57 MojoExecutionException
-58 {
-59super.execute(outputFile);
-60 }
-61
-62
-63 @Override
-64void build(
-65 MetadataImplementor metadata,
-66 ExecutionOptions options,
-67 TargetDescriptor target
-68 )
-69throws
-70 MojoExecutionException,
-71 MojoFailureException
-72 {
-73 ServiceRegistry service =
-74 metadata.getMetadataBuildingOptions().getServiceRegistry();
-75 SchemaManagementTool tool = service.getService(SchemaManagementTool.class);
-76
-77 Map config = options.getConfigurationValues();
-78
-79 tool.getSchemaMigrator(config).doMigration(metadata, options, target);
-80 }
-81 }
-
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
+
+
Package
+
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
+
+
Interfaces (italic)
+
Classes
+
Enums
+
Exceptions
+
Errors
+
Annotation Types
+
+
+
+
Class/Interface
+
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
+
+
Class inheritance diagram
+
Direct Subclasses
+
All Known Subinterfaces
+
All Known Implementing Classes
+
Class/interface declaration
+
Class/interface description
+
+
+
Nested Class Summary
+
Field Summary
+
Constructor Summary
+
Method Summary
+
+
+
Field Detail
+
Constructor Detail
+
Method Detail
+
+
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+
+
+
Annotation Type
+
Each annotation type has its own separate page with the following sections:
+
+
Annotation Type declaration
+
Annotation Type description
+
Required Element Summary
+
Optional Element Summary
+
Element Detail
+
+
+
+
Enum
+
Each enum has its own separate page with the following sections:
+
+
Enum declaration
+
Enum description
+
Enum Constant Summary
+
Enum Constant Detail
+
+
+
+
Use
+
Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
+
+
+
Tree (Class Hierarchy)
+
There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
+
+
When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
+
When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+
+
+
+
Deprecated API
+
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+
+
+
Index
+
The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+
+
+
Prev/Next
+
These links take you to the next or previous class, interface, package, or related page.
+
+
+
Frames/No Frames
+
These links show and hide the HTML frames. All pages are available with or without frames.
+
+
+
All Classes
+
The All Classes link shows all classes and interfaces except non-static nested types.
+
+
+
Serialized Form
+
Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to Non-frame version.
+ The most simple way to configure the plugin is, to put all the
+ hibernate-configuration in a hibernate.properties- or
+ a hibernate.cfg.xml-file on your classpath or in the
+ persistence.xml-file of your JPA-configuration, just
+ like you would do, if you are not using the
+ hibernate-maven-plugin.
+
+
+
+ Doing so, the only additionally configuration needed, to activat the plugin
+ is the following entry in the plugins-section of your pom.xml:
+
+ A correspondin goal for the command update is missing in this
+ version, but we are planning to implement it in near feature.
+
+
+
+ In order to let this configuration work, your configuration file must
+ contain a complete valid configuration for the database, that you want
+ to use.
+ A simple example hibernate.properties-file may look like this:
+
+ But be aware, that using this configuration-approach the database-url,
+ that is build in the application is the same that is used while testing,
+ where the database is droped and recreated by the plugin.
+ Because of that,
+
+ you should never fire up this configuration on your production
+ system, or your database might be erased!
+
+
+
+
+ A better approach is, to specify a different url for testing like in the
+ following snippet:
+
+ Configuration properties, that are set in the configuration-section
+ of the plugin-configuration cannnot be overwritten elsewere (for details
+ see Configuration-Method-Precedence).
+ You never can overwrite them by accident when specifying a property on
+ the commandline or in your settings.xml.
+
+
+
+
Configuration through maven-properties
+
+
+ Alternatively, it is possible, to configure the plugin via maven-properties.
+ Each relevant configuration-option has a corresponding maven-property
+ (for a full list see the Documentation of the goal create).
+ These are named after the
+ Hibernate JDBC Properties:
+
+
+
+
+
hibernate.connection.driver_class
+
+
hibernate.dialect
+
+
hibernate.connection.url
+
+
hibernate.connection.username
+
+
hibernate.connection.password
+
+
+
+ So, instead of writing the hibernate-configuration in the properties-file,
+ like above, you could put it in the properties-section of your
+ pom.xml.
+
+
+
+ Thogether with the plugin-definition from above, the following would
+ be a complete configuration (again, the database-url was overwritten in
+ the plugin-configuration, to be sure to have a separate database for
+ testing):
+
+ This way, you can reuse the same properties to provide a
+ default-configurationthe, that is build into your application, and
+ overwrite the database-url, that is used during testing to prevent
+ accidential drops of your production database.
+
+
+
+
Configuration through the plugin-configuration
+
+
+ A third way for configuring the plugin is the plugin-configuration.
+ The relevant configuration-parameters are:
+
+
+
+
+
driver
+
+
dialect
+
+
url
+
+
username
+
+
password
+
+
+
+ The equivalent of the configuration from the last section would look
+ like this:
+
+ The parameter hibernateProperties (name of the hibernate-properties-file
+ to use, defaults to hibernate.properties) can only be configured through
+ this approach.
+
+ If you are in doubt about where a configuration-value comes from, run
+ maven with the debug-output enabled: mvn -X hibernate:create
+ and be aware, that maven-properties can be overwitten on the command-line,
+ in your ~/.m2/settings.xml and in a profile.
+
+
+
+ The plugin-configuration comes last and overwrites everything else.
+ That way, you can be sure, that a configuration-value, that is
+ specified in the plugin-configuration will never be overwritten by any
+ other configuration-method.
+
+
+
+ If you need to overwrite plugin-configuration-values with
+ maven-properties, you can use maven-properties in the plugin-configuration:
+
Specifies whether to automatically create also the database
+schema/catalog. Default value is: false. User property is: hibernate.hbm2dll.create_namespaces.
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Default value is: ;. User property is: hibernate.hbm2ddl.delimiter.
Excecute the generated SQL. If set to false, only the
+SQL-script is created and the database is not touched.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Default value is: true. User property is: hibernate.schema.execute.
Force the generation and (if configured) the execution of the
+SQL, even if no modified or newly added annotated classes where
+found and the configuration was not changed.
+
+
skip takes precedence over force.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Default value is: false. User property is: hibernate.schema.force.
Path to Hibernate configuration file (.cfg.xml). If this parameter
+is specified, the plugin will try to load configuration values from
+a file with the given path or a ressource on the classpath with the
+given name. If both fails, the execution of the plugin will fail.
+
+
If this parameter is not set the plugin will load configuration
+values from a ressource named hibernate.cfg.xml on the
+classpath, if it is present, but will not fail if there is no such
+ressource.
+
+
During ressource-lookup, the test-classpath takes
+precedence.
+
+
Settings in this file will overwrite settings in the properties
+file.
Path to a file or name of a ressource with hibernate properties. If
+this parameter is specified, the plugin will try to load
+configuration values from a file with the given path or a ressource
+on the classpath with the given name. If both fails, the execution
+of the plugin will fail.
+
+
If this parameter is not set the plugin will load configuration
+values from a ressource named hibernate.properties on
+the classpath, if it is present, but will not fail if there is no
+such ressource.
+
+
During ressource-lookup, the test-classpath takes
+precedence.
This parameter defaults to the maven build-output-directory for
+classes. Additionally, all dependencies are scanned for annotated
+classes.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Name of the persistence-unit. If this parameter is specified, the
+plugin will try to load configuration values from a
+persistence-unit with the specified name. If no such
+persistence-unit can be found, the plugin will throw an exception.
+
+
If this parameter is not set and there is only one
+persistence-unit available, that unit will be used automatically.
+But if this parameter is not set and there are multiple
+persistence-units available on, the class-path, the execution of
+the plugin will fail.
+
+
Settings in this file will overwrite settings in the properties
+or the configuration file.
Wether the project should be scanned for annotated-classes, or not
+
+
This parameter is intended to allow overwriting of the parameter
+exclude-unlisted-classes of a
+persistence-unit. If not specified, it defaults to
+true
Dependency-Scopes, that should be scanned for annotated classes.
+
+
By default, only dependencies in the scope compile
+are scanned for annotated classes. Multiple scopes can be seperated
+by white space or commas.
+
+
If you do not want any dependencies to be scanned for annotated
+classes, set this parameter to none.
+
+
The plugin does not scan for annotated classes in transitive
+dependencies. If some of your annotated classes are hidden in a
+transitive dependency, you can simply add that dependency
+explicitly.
Default value is: compile. User property is: hibernate.schema.scan.dependencies.
Whether to scan the test-branch of the project for annotated
+classes, or not.
+
+
If this parameter is set to true the test-classes
+of the artifact will be scanned for hibernate-annotated classes
+additionally.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Default value is: false. User property is: hibernate.schema.scan.test_classes.
A skipped execution is signaled via the maven-property
+${hibernate.schema.skipped}.
+
+
The execution is skipped automatically, if no modified or newly
+added annotated classes are found and the dialect was not
+changed.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Default value is: ${maven.test.skip}. User property is: hibernate.schema.skip.
This parameter defaults to the maven build-output-directory for
+test-classes.
+
+
This parameter is only used, when scanTestClasses
+is set to true!
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
User property is: project.build.testOutputDirectory.
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Excecute the generated SQL. If set to false, only the
+SQL-script is created and the database is not touched.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Force the generation and (if configured) the execution of the
+SQL, even if no modified or newly added annotated classes where
+found and the configuration was not changed.
+
+
skip takes precedence over force.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Path to Hibernate configuration file (.cfg.xml). If this parameter
+is specified, the plugin will try to load configuration values from
+a file with the given path or a ressource on the classpath with the
+given name. If both fails, the execution of the plugin will fail.
+
+
If this parameter is not set the plugin will load configuration
+values from a ressource named hibernate.cfg.xml on the
+classpath, if it is present, but will not fail if there is no such
+ressource.
+
+
During ressource-lookup, the test-classpath takes
+precedence.
+
+
Settings in this file will overwrite settings in the properties
+file.
Path to a file or name of a ressource with hibernate properties. If
+this parameter is specified, the plugin will try to load
+configuration values from a file with the given path or a ressource
+on the classpath with the given name. If both fails, the execution
+of the plugin will fail.
+
+
If this parameter is not set the plugin will load configuration
+values from a ressource named hibernate.properties on
+the classpath, if it is present, but will not fail if there is no
+such ressource.
+
+
During ressource-lookup, the test-classpath takes
+precedence.
This parameter defaults to the maven build-output-directory for
+classes. Additionally, all dependencies are scanned for annotated
+classes.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Name of the persistence-unit. If this parameter is specified, the
+plugin will try to load configuration values from a
+persistence-unit with the specified name. If no such
+persistence-unit can be found, the plugin will throw an exception.
+
+
If this parameter is not set and there is only one
+persistence-unit available, that unit will be used automatically.
+But if this parameter is not set and there are multiple
+persistence-units available on, the class-path, the execution of
+the plugin will fail.
+
+
Settings in this file will overwrite settings in the properties
+or the configuration file.
Wether the project should be scanned for annotated-classes, or not
+
+
This parameter is intended to allow overwriting of the parameter
+exclude-unlisted-classes of a
+persistence-unit. If not specified, it defaults to
+true
Dependency-Scopes, that should be scanned for annotated classes.
+
+
By default, only dependencies in the scope compile
+are scanned for annotated classes. Multiple scopes can be seperated
+by white space or commas.
+
+
If you do not want any dependencies to be scanned for annotated
+classes, set this parameter to none.
+
+
The plugin does not scan for annotated classes in transitive
+dependencies. If some of your annotated classes are hidden in a
+transitive dependency, you can simply add that dependency
+explicitly.
Whether to scan the test-branch of the project for annotated
+classes, or not.
+
+
If this parameter is set to true the test-classes
+of the artifact will be scanned for hibernate-annotated classes
+additionally.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
A skipped execution is signaled via the maven-property
+${hibernate.schema.skipped}.
+
+
The execution is skipped automatically, if no modified or newly
+added annotated classes are found and the dialect was not
+changed.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
This parameter defaults to the maven build-output-directory for
+test-classes.
+
+
This parameter is only used, when scanTestClasses
+is set to true!
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
+ If you are new to hibernate-maven-plugin, in many cases, the
+ Configuration-Method-Precedence
+ may be the source of configuration errors.
+ To solve this problem, you should run maven with the debugging output
+ enabled.
+ For example, by executing:
+
+
+
+
+mvn -X compile hibernate:create
+
+
+ (The compile might be necessary, because hibernate-maven-plugin
+ has to scan the compiled classes for annotations!)
+
+
+
+ Unlike the majority of the maven-plugins, hibernate-maven-plugin was
+ designed to give a good many hints, when debugging is enabled.
+ Because, if you do not know, what went wrong, you can't fix it!
+
+
+
+ But be warned:hibernate-maven-plugin tends to be very chatty ;)
+
Description: Maven is a software build management and
+ comprehension tool. Based on the concept of a project object model:
+ builds, dependency management, documentation creation, site
+ publication, and distribution publication are all controlled from
+ the declarative file. Maven can be extended by plugins to utilise a
+ number of other development tools for reporting or the build
+ process.
Description: Guava is a suite of core and expanded libraries that include
+ utility classes, google's collections, io classes, and much
+ much more.
+
+ Guava has only one code dependency - javax.annotation,
+ per the JSR-305 spec.
Description: Plexus Component "Java 5" Annotations, to describe plexus components properties in java sources with
+ standard annotations instead of javadoc annotations.
Description: A framework for constructing recognizers, compilers,
+ and translators from grammatical descriptions containing
+ Java, C#, C++, or Python actions.
Specifies whether to automatically create also the database
+schema/catalog. Default value is: false. User property is: hibernate.hbm2dll.create_namespaces.
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Default value is: ;. User property is: hibernate.hbm2ddl.delimiter.
Excecute the generated SQL. If set to false, only the
+SQL-script is created and the database is not touched.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Default value is: true. User property is: hibernate.schema.execute.
Force the generation and (if configured) the execution of the
+SQL, even if no modified or newly added annotated classes where
+found and the configuration was not changed.
+
+
skip takes precedence over force.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Default value is: false. User property is: hibernate.schema.force.
Path to Hibernate configuration file (.cfg.xml). If this parameter
+is specified, the plugin will try to load configuration values from
+a file with the given path or a ressource on the classpath with the
+given name. If both fails, the execution of the plugin will fail.
+
+
If this parameter is not set the plugin will load configuration
+values from a ressource named hibernate.cfg.xml on the
+classpath, if it is present, but will not fail if there is no such
+ressource.
+
+
During ressource-lookup, the test-classpath takes
+precedence.
+
+
Settings in this file will overwrite settings in the properties
+file.
Path to a file or name of a ressource with hibernate properties. If
+this parameter is specified, the plugin will try to load
+configuration values from a file with the given path or a ressource
+on the classpath with the given name. If both fails, the execution
+of the plugin will fail.
+
+
If this parameter is not set the plugin will load configuration
+values from a ressource named hibernate.properties on
+the classpath, if it is present, but will not fail if there is no
+such ressource.
+
+
During ressource-lookup, the test-classpath takes
+precedence.
This parameter defaults to the maven build-output-directory for
+classes. Additionally, all dependencies are scanned for annotated
+classes.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Name of the persistence-unit. If this parameter is specified, the
+plugin will try to load configuration values from a
+persistence-unit with the specified name. If no such
+persistence-unit can be found, the plugin will throw an exception.
+
+
If this parameter is not set and there is only one
+persistence-unit available, that unit will be used automatically.
+But if this parameter is not set and there are multiple
+persistence-units available on, the class-path, the execution of
+the plugin will fail.
+
+
Settings in this file will overwrite settings in the properties
+or the configuration file.
Wether the project should be scanned for annotated-classes, or not
+
+
This parameter is intended to allow overwriting of the parameter
+exclude-unlisted-classes of a
+persistence-unit. If not specified, it defaults to
+true
Dependency-Scopes, that should be scanned for annotated classes.
+
+
By default, only dependencies in the scope compile
+are scanned for annotated classes. Multiple scopes can be seperated
+by white space or commas.
+
+
If you do not want any dependencies to be scanned for annotated
+classes, set this parameter to none.
+
+
The plugin does not scan for annotated classes in transitive
+dependencies. If some of your annotated classes are hidden in a
+transitive dependency, you can simply add that dependency
+explicitly.
Default value is: compile. User property is: hibernate.schema.scan.dependencies.
Whether to scan the test-branch of the project for annotated
+classes, or not.
+
+
If this parameter is set to true the test-classes
+of the artifact will be scanned for hibernate-annotated classes
+additionally.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Default value is: false. User property is: hibernate.schema.scan.test_classes.
A skipped execution is signaled via the maven-property
+${hibernate.schema.skipped}.
+
+
The execution is skipped automatically, if no modified or newly
+added annotated classes are found and the dialect was not
+changed.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Default value is: ${maven.test.skip}. User property is: hibernate.schema.skip.
This parameter defaults to the maven build-output-directory for
+test-classes.
+
+
This parameter is only used, when scanTestClasses
+is set to true!
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
User property is: project.build.testOutputDirectory.
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Excecute the generated SQL. If set to false, only the
+SQL-script is created and the database is not touched.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Force the generation and (if configured) the execution of the
+SQL, even if no modified or newly added annotated classes where
+found and the configuration was not changed.
+
+
skip takes precedence over force.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Path to Hibernate configuration file (.cfg.xml). If this parameter
+is specified, the plugin will try to load configuration values from
+a file with the given path or a ressource on the classpath with the
+given name. If both fails, the execution of the plugin will fail.
+
+
If this parameter is not set the plugin will load configuration
+values from a ressource named hibernate.cfg.xml on the
+classpath, if it is present, but will not fail if there is no such
+ressource.
+
+
During ressource-lookup, the test-classpath takes
+precedence.
+
+
Settings in this file will overwrite settings in the properties
+file.
Path to a file or name of a ressource with hibernate properties. If
+this parameter is specified, the plugin will try to load
+configuration values from a file with the given path or a ressource
+on the classpath with the given name. If both fails, the execution
+of the plugin will fail.
+
+
If this parameter is not set the plugin will load configuration
+values from a ressource named hibernate.properties on
+the classpath, if it is present, but will not fail if there is no
+such ressource.
+
+
During ressource-lookup, the test-classpath takes
+precedence.
This parameter defaults to the maven build-output-directory for
+classes. Additionally, all dependencies are scanned for annotated
+classes.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Name of the persistence-unit. If this parameter is specified, the
+plugin will try to load configuration values from a
+persistence-unit with the specified name. If no such
+persistence-unit can be found, the plugin will throw an exception.
+
+
If this parameter is not set and there is only one
+persistence-unit available, that unit will be used automatically.
+But if this parameter is not set and there are multiple
+persistence-units available on, the class-path, the execution of
+the plugin will fail.
+
+
Settings in this file will overwrite settings in the properties
+or the configuration file.
Wether the project should be scanned for annotated-classes, or not
+
+
This parameter is intended to allow overwriting of the parameter
+exclude-unlisted-classes of a
+persistence-unit. If not specified, it defaults to
+true
Dependency-Scopes, that should be scanned for annotated classes.
+
+
By default, only dependencies in the scope compile
+are scanned for annotated classes. Multiple scopes can be seperated
+by white space or commas.
+
+
If you do not want any dependencies to be scanned for annotated
+classes, set this parameter to none.
+
+
The plugin does not scan for annotated classes in transitive
+dependencies. If some of your annotated classes are hidden in a
+transitive dependency, you can simply add that dependency
+explicitly.
Whether to scan the test-branch of the project for annotated
+classes, or not.
+
+
If this parameter is set to true the test-classes
+of the artifact will be scanned for hibernate-annotated classes
+additionally.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
A skipped execution is signaled via the maven-property
+${hibernate.schema.skipped}.
+
+
The execution is skipped automatically, if no modified or newly
+added annotated classes are found and the dialect was not
+changed.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
This parameter defaults to the maven build-output-directory for
+test-classes.
+
+
This parameter is only used, when scanTestClasses
+is set to true!
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
+ The hibernate-maven-plugin computes MD5-sums for all found annotated
+ classes and stores them together with the generated schema.
+ If no classes were changed or added and the dialect wasn't changed too, it
+ automatically skips the configured SQL-generation — and more
+ important in this respect — the execution of the generated SQL,
+ to speed up the development cycle.
+
+
+
+ The plugin signals, that the execution was skipped by setting the maven
+ property ${hibernate.schema.skipped} to true.
+ This may be helpful, because other plugins like
+ dbunit-plugin
+ may fail, when the execution is skipped.
+
+
+
+ If you need the hibernate-maven-plugin to never skip execution automatically,
+ you can force it to do so, if you set the parameter force to
+ true:
+
A simple plugin for generating a database-schema from Hibernate-Mappings
+
+
+ The hibernate-maven-plugin is a plugin for generating a database-schema
+ from your Hibernate-Mappings and create or update your database
+ accordingly.
+ Its main usage is to automatically create and populate a test-database
+ for unit-tests in cooperation with the
+ dbunit-maven-plugin.
+
+
+
+ The plugin was designed with three main goals in mind:
+
+
+
+
+
It should be easy to use.
+
+
It should be maximal unlikely, to erase a producation-database by accident.
+
+
It should not slow down the development cycle.
+
+
+
+ To achieve the first goal, the convention-over-configuration paradigma
+ was applied and the plugin was stuffed with usefull logging-messages.
+ So, if in doubt, just turn on the debugging output with the mvn -X ....
+
+
+
+ To achieve the second goal, the precedence in which the configuration
+ locations are consulted was layouted in a way that makes it possible, to
+ prevent overwrites of the wrong database by accident.
+
+
+
+ Last but not least, in order to not slow down the development cycle, the
+ hibernate-maven-plugin only executes the generated SQL, if the mapping
+ or the configuration has changed (or if you force it to do so).
+
+ See Configuration Examples for Usage-Explanations
+ and simple examples of how to use this plugin.
+
+
+
+ See hibernate:create,
+ See hibernate:drop and
+ Plugin Documentation for the full
+ autogenerated documentation. These are mostly configuration-options
+ from the Hibernate-Tooling, that does the work in the background.
+
Typically the licenses listed for the project are that of the project itself, and not of dependencies.
+
+
Project Licenses
+
+
The Apache Software License, Version 2.0
+
A business-friendly OSS license
+
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
+
+ hibernate-maven-plugin by default scans dependencies in the scope
+ compile. You can configure it to scan dependencies in other
+ scopes as well. But it scans only direct dependencies. Transitive
+ dependencies are not scanned for annotated classes. If some of your
+ annotated classes are hidden in a transitive dependency, you can simply
+ add that dependency explicitly.
+
+
+
+
hibernate-maven-plugin always needs a database-connection
+
+
+ The default-configuration executes the created SQL.
+ Therefore, it needs a valid database-connection and fails, if none is
+ available.
+ If you do not need the generated SQL to be executed automatically,
+ you can set the property hibernate.schema.execute to
+ false.
+ This can be achieved with the command-line parameter
+ -Dhibernate.schema.execute=false or with the following
+ configuration:
+
+ But even when no database is to be created, hibernate always needs to know
+ the dialect. Hence, the plugin will still fail, if this parameter is also
+ missing!
+
+
+
+
Dependency for driver-class XYZ is missing
+
+
+ One regular problem is the scope of the jdbc-driver-dependency.
+ It is very unlikely, that this dependency is needed at compile-time.
+ So a tidy maven-developer would usually scope it for runtime.
+
+
+
+ But this will break the execution of the hibernate-maven-plugin.
+ Since it will not be able to see the needed dependency, it will fail with
+ an error-message like:
+
+
+
+
+[INFO] Gathered hibernate-configuration (turn on debugging for details):
+[INFO] hibernate.connection.username = sa
+[INFO] hibernate.connection.password =
+[INFO] hibernate.dialect = org.hibernate.dialect.H2Dialect
+[INFO] hibernate.connection.url = jdbc:h2:file:./db
+[INFO] hibernate.hbm2dll.create_namespaces = false
+[INFO] hibernate.connection.driver_class = org.h2.Driver
+[INFO] hibernate.format_sql = true
+[INFO] HHH000412: Hibernate Core {5.0.2.Final}
+[INFO] HHH000206: hibernate.properties not found
+[INFO] HHH000021: Bytecode provider name : javassist
+[INFO] Adding /home/kai/project/target/classes to the list of roots to scan...
+[INFO] Adding dependencies from scope compile to the list of roots to scan
+[INFO] Adding dependencies from scope org.hibernate:hibernate-core:jar:4.3.0.Final to the list of roots to scan
+[INFO] Adding annotated resource: de.juplo.tests.SimplestMavenHib4Test
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD FAILURE
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 1.760s
+[INFO] Finished at: Mon Mar 07 19:06:54 CET 2016
+[INFO] Final Memory: 11M/215M
+[INFO] ------------------------------------------------------------------------
+[ERROR] Failed to execute goal de.juplo:hibernate-maven-plugin:2.1.0:drop (default) on project hibernate4-properties-test: Could not open the JDBC-connection: Unable to load class [org.h2.Driver]: Could not load requested class : org.h2.Driver -> [Help 1]
+[ERROR]
+[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
+[ERROR] Re-run Maven using the -X switch to enable full debug logging.
+[ERROR]
+[ERROR] For more information about the errors and possible solutions, please read the following articles:
+[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
+
+
+ A quick workaround for this error would be, to delete the runtime-constraint
+ for the jdbc-driver-dependency.
+
+
+
+ A much cleaner way is, to (additionally) ad the dependency, to the
+ plugin-definition:
+
+ This is also the best way, if you use a different jdbc-driver for
+ testing, than in production.
+ Because otherwise, this dependency will unnecessarily bloat the
+ runtime-dependencies of your project.
+
+
+
+
DBUnit fails after execution of hibernate was skipped because nothing has changed
+
+
+ If hibernate-maven-plugin skips its excecution, this may lead to errors in
+ other plugins.
+ For example, when importing sample-data in the automatically created database
+ with the help of the dbunit-plugin,
+ the CLEAN_INSERT-operation may fail because of foreign-key-constraints,
+ if the database was not recreated, because the hibernate-maven-plugin has
+ skipped its excecution.
+
+
+
+ A quick fix to this problem is, to force
+ hibernate-maven-plugin to generate and execute the SQL every time it is running.
+ But to recreate the database on every testrun may noticeable slow down your
+ development cycle, if you have to wait for slow IO.
+
+
+
+ To circumvent this problem, hibernate-maven-plugin signals a skipped
+ excecution by setting the maven property ${hibernate.schema.skipped} to
+ true.
+ You can configure other plugins to react on this signal.
+ For example, the dbunit-plugin can be configured to skip its excecution, if
+ hibernate-maven-plugin was skipped like this:
+
The database will not be recreated after a manual drop/clean
+
+
+ If one manually drops the database or removes the hsqldb-files, it will not
+ be recreated by the hibernate-maven-plugin, because it cannot detect, that
+ the database needs to be recreated.
+ This happens, because the plugin will not recreate the database if neither
+ the configuration nor the annotated classes have changed, because an
+ unnecessary drop-create-cycle might take a long time. The plugin will
+ report that like this:
+
+
+
+
+[INFO] No modified annotated classes found and dialect unchanged.
+[INFO] Skipping schema generation!
+
+
+ If one always uses mvn clean for cleanup, this will not happen.
+ Otherwise the recreation must be forced:
+
The hibernate:create goal is not executed, when tests are skipped
+
+
+ The hibernate-maven-plugin automatically skips its execution, when
+ maven.test.skip is set to true. If you need it to be always
+ executed, you can configure that explicitly like this:
+
I do not want my dependencies to be scanned for hibernate annotations
+
+
+ If you do not want your dependencies to be scanned for hibernate annotations,
+ you can pass -Dhibernate.schema.scan.dependencies=none to maven
+ or set scanDependencies to none in the configuration
+ of the plugin like this:
+
+ If you are working under Windows and get the error-message
+ No annotated classes found in directory C:\projects\X Y Z\path-to-project\target\classes,
+ but you are really sure, that there are annotated classes in that
+ directory, you are expiriencing a bug, in the scannotation-library, that
+ was closed in version 1.1.0 of the hibernate-maven-plugin.
+
+
+
+
+ You should consider to upgrade to the latest version of the plugin.
+
+
+
+
+
If two goals are specified, the second one is always skipped
+
+
+ If you specify two goals, for example drop and
+ create, each goal has to be specified in its own
+ execution, so that you can specify two different
+ output-files for the two goals.
+ Otherwise, both goals will use the same output-file and the goal, that
+ is run second, will always skip, becaus it will find, that the output
+ file already exists and conclude, that its work was already done in a
+ prior run.
+
This document provides an overview of the various documents and links that are part of this project's general information. All of this content is automatically generated by Maven on behalf of the project.
This document provides information on the members of this project. These are the individuals who have contributed to the project in one form or another.
+ In most use-cases, the hibernate-maven-plugin is used to create a
+ test-database automatically. In this use-cases, it is very likely, that it
+ will result in mistakes/errors, if the goal is executed, when the tests
+ are skipped.
+ For example, one might manually overwrite the database-url with the url of
+ the production-database, in order to run other tests, like starting a
+ local webserver with the
+ jetty-maven-plugin.
+ If the drop-goal would be executed in such a scenario, it might erase the
+ hole production-database, which is not very desireable.
+
+
+
+ Because of this, the configuration-parameter skip defaults to the value
+ of the proptery maven.test.skip. This way, the execution of the
+ hibernate-maven-plugin is skipped automatically, when the tests are
+ skipped. Think of it as a build-in security-belt.
+
+
+
+ If you do not like that, because you need the plugin to always,
+ even if the tests are skipped you can configure that explicitly,
+ by setting the configuration-parameter skip to false:
+
+ Or, if you want the plugin to be executed by default and to be skipped
+ if you say so, you can bind the value of the configuration-parameter
+ skip to a custom property. For example:
+
+ This way, the plugin would be skipped, if you set the property
+ foo.bar to true. For example, if you specify -Dfoo.bar=true
+ on the command-line.
+
A successful project requires many people to play many roles. Some members write code or documentation, while others are valuable as testers, submitting patches and suggestions.
+
The project team is comprised of Members and Contributors. Members have direct access to the source of a project and actively evolve the code-base. Contributors improve the project through submission of patches and suggestions to the Members. The number of Contributors to the project is unbounded. Get involved today. All contributions to the project are greatly appreciated.
+
+
Members
+
The following is a list of developers with commit privileges that have directly contributed to the project in one way or another.
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
+
+
Package
+
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
+
+
Interfaces (italic)
+
Classes
+
Enums
+
Exceptions
+
Errors
+
Annotation Types
+
+
+
+
Class/Interface
+
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
+
+
Class inheritance diagram
+
Direct Subclasses
+
All Known Subinterfaces
+
All Known Implementing Classes
+
Class/interface declaration
+
Class/interface description
+
+
+
Nested Class Summary
+
Field Summary
+
Constructor Summary
+
Method Summary
+
+
+
Field Detail
+
Constructor Detail
+
Method Detail
+
+
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+
+
+
Annotation Type
+
Each annotation type has its own separate page with the following sections:
+
+
Annotation Type declaration
+
Annotation Type description
+
Required Element Summary
+
Optional Element Summary
+
Element Detail
+
+
+
+
Enum
+
Each enum has its own separate page with the following sections:
+
+
Enum declaration
+
Enum description
+
Enum Constant Summary
+
Enum Constant Detail
+
+
+
+
Use
+
Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
+
+
+
Tree (Class Hierarchy)
+
There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
+
+
When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
+
When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+
+
+
+
Deprecated API
+
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+
+
+
Index
+
The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+
+
+
Prev/Next
+
These links take you to the next or previous class, interface, package, or related page.
+
+
+
Frames/No Frames
+
These links show and hide the HTML frames. All pages are available with or without frames.
+
+
+
All Classes
+
The All Classes link shows all classes and interfaces except non-static nested types.
+
+
+
Serialized Form
+
Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
+
+
diff --git a/projects/hibernate-maven-plugin/2.1.0/testapidocs/index.html b/projects/hibernate-maven-plugin/2.1.0/testapidocs/index.html
new file mode 100644
index 0000000..a439561
--- /dev/null
+++ b/projects/hibernate-maven-plugin/2.1.0/testapidocs/index.html
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+Hibernate Maven Plugin 2.1.0 Test API
+
+
+
+
+
+
+
+
Frame Alert
+
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to Non-frame version.
Specifies whether to automatically create also the database
+schema/catalog. Default value is: false. User property is: hibernate.hbm2dll.create_namespaces.
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Default value is: ;. User property is: hibernate.hbm2ddl.delimiter.
Excecute the generated SQL. If set to false, only the
+SQL-script is created and the database is not touched.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Default value is: true. User property is: hibernate.schema.execute.
Force the generation and (if configured) the execution of the
+SQL, even if no modified or newly added annotated classes where
+found and the configuration was not changed.
+
+
skip takes precedence over force.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Default value is: false. User property is: hibernate.schema.force.
Path to Hibernate configuration file (.cfg.xml). If this parameter
+is specified, the plugin will try to load configuration values from
+a file with the given path or a ressource on the classpath with the
+given name. If both fails, the execution of the plugin will fail.
+
+
If this parameter is not set the plugin will load configuration
+values from a ressource named hibernate.cfg.xml on the
+classpath, if it is present, but will not fail if there is no such
+ressource.
+
+
During ressource-lookup, the test-classpath takes
+precedence.
+
+
Settings in this file will overwrite settings in the properties
+file.
Path to a file or name of a ressource with hibernate properties. If
+this parameter is specified, the plugin will try to load
+configuration values from a file with the given path or a ressource
+on the classpath with the given name. If both fails, the execution
+of the plugin will fail.
+
+
If this parameter is not set the plugin will load configuration
+values from a ressource named hibernate.properties on
+the classpath, if it is present, but will not fail if there is no
+such ressource.
+
+
During ressource-lookup, the test-classpath takes
+precedence.
This parameter defaults to the maven build-output-directory for
+classes. Additionally, all dependencies are scanned for annotated
+classes.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Name of the persistence-unit. If this parameter is specified, the
+plugin will try to load configuration values from a
+persistence-unit with the specified name. If no such
+persistence-unit can be found, the plugin will throw an exception.
+
+
If this parameter is not set and there is only one
+persistence-unit available, that unit will be used automatically.
+But if this parameter is not set and there are multiple
+persistence-units available on, the class-path, the execution of
+the plugin will fail.
+
+
Settings in this file will overwrite settings in the properties
+or the configuration file.
Wether the project should be scanned for annotated-classes, or not
+
+
This parameter is intended to allow overwriting of the parameter
+exclude-unlisted-classes of a
+persistence-unit. If not specified, it defaults to
+true
Dependency-Scopes, that should be scanned for annotated classes.
+
+
By default, only dependencies in the scope compile
+are scanned for annotated classes. Multiple scopes can be seperated
+by white space or commas.
+
+
If you do not want any dependencies to be scanned for annotated
+classes, set this parameter to none.
+
+
The plugin does not scan for annotated classes in transitive
+dependencies. If some of your annotated classes are hidden in a
+transitive dependency, you can simply add that dependency
+explicitly.
Default value is: compile. User property is: hibernate.schema.scan.dependencies.
Whether to scan the test-branch of the project for annotated
+classes, or not.
+
+
If this parameter is set to true the test-classes
+of the artifact will be scanned for hibernate-annotated classes
+additionally.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Default value is: false. User property is: hibernate.schema.scan.test_classes.
A skipped execution is signaled via the maven-property
+${hibernate.schema.skipped}.
+
+
The execution is skipped automatically, if no modified or newly
+added annotated classes are found and the dialect was not
+changed.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Default value is: ${maven.test.skip}. User property is: hibernate.schema.skip.
This parameter defaults to the maven build-output-directory for
+test-classes.
+
+
This parameter is only used, when scanTestClasses
+is set to true!
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
User property is: project.build.testOutputDirectory.
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Excecute the generated SQL. If set to false, only the
+SQL-script is created and the database is not touched.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Force the generation and (if configured) the execution of the
+SQL, even if no modified or newly added annotated classes where
+found and the configuration was not changed.
+
+
skip takes precedence over force.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Path to Hibernate configuration file (.cfg.xml). If this parameter
+is specified, the plugin will try to load configuration values from
+a file with the given path or a ressource on the classpath with the
+given name. If both fails, the execution of the plugin will fail.
+
+
If this parameter is not set the plugin will load configuration
+values from a ressource named hibernate.cfg.xml on the
+classpath, if it is present, but will not fail if there is no such
+ressource.
+
+
During ressource-lookup, the test-classpath takes
+precedence.
+
+
Settings in this file will overwrite settings in the properties
+file.
Path to a file or name of a ressource with hibernate properties. If
+this parameter is specified, the plugin will try to load
+configuration values from a file with the given path or a ressource
+on the classpath with the given name. If both fails, the execution
+of the plugin will fail.
+
+
If this parameter is not set the plugin will load configuration
+values from a ressource named hibernate.properties on
+the classpath, if it is present, but will not fail if there is no
+such ressource.
+
+
During ressource-lookup, the test-classpath takes
+precedence.
This parameter defaults to the maven build-output-directory for
+classes. Additionally, all dependencies are scanned for annotated
+classes.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
Name of the persistence-unit. If this parameter is specified, the
+plugin will try to load configuration values from a
+persistence-unit with the specified name. If no such
+persistence-unit can be found, the plugin will throw an exception.
+
+
If this parameter is not set and there is only one
+persistence-unit available, that unit will be used automatically.
+But if this parameter is not set and there are multiple
+persistence-units available on, the class-path, the execution of
+the plugin will fail.
+
+
Settings in this file will overwrite settings in the properties
+or the configuration file.
Wether the project should be scanned for annotated-classes, or not
+
+
This parameter is intended to allow overwriting of the parameter
+exclude-unlisted-classes of a
+persistence-unit. If not specified, it defaults to
+true
Dependency-Scopes, that should be scanned for annotated classes.
+
+
By default, only dependencies in the scope compile
+are scanned for annotated classes. Multiple scopes can be seperated
+by white space or commas.
+
+
If you do not want any dependencies to be scanned for annotated
+classes, set this parameter to none.
+
+
The plugin does not scan for annotated classes in transitive
+dependencies. If some of your annotated classes are hidden in a
+transitive dependency, you can simply add that dependency
+explicitly.
Whether to scan the test-branch of the project for annotated
+classes, or not.
+
+
If this parameter is set to true the test-classes
+of the artifact will be scanned for hibernate-annotated classes
+additionally.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
A skipped execution is signaled via the maven-property
+${hibernate.schema.skipped}.
+
+
The execution is skipped automatically, if no modified or newly
+added annotated classes are found and the dialect was not
+changed.
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
This parameter defaults to the maven build-output-directory for
+test-classes.
+
+
This parameter is only used, when scanTestClasses
+is set to true!
+
+
Important: This configuration value can only be
+configured through the pom.xml, or by the definition
+of a system-property, because it is not known by Hibernate nor JPA
+and, hence, not picked up from their configuration!
+1package de.juplo.plugins.hibernate;
+2
+3/*
+4 * Copyright 2001-2005 The Apache Software Foundation.
+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
+19import java.util.Map;
+20import org.apache.maven.plugin.MojoExecutionException;
+21import org.apache.maven.plugin.MojoFailureException;
+22import org.hibernate.boot.spi.MetadataImplementor;
+23import org.hibernate.service.ServiceRegistry;
+24import org.hibernate.tool.schema.spi.ExecutionOptions;
+25import org.hibernate.tool.schema.spi.SchemaManagementTool;
+26import org.hibernate.tool.schema.spi.TargetDescriptor;
+27
+28
+29/**
+30 * Generate/Execute SQL to update the database-schema according to the
+31 * configured mappings.
+32 *
+33 * @goal update
+34 * @phase process-classes
+35 * @threadSafe
+36 * @requiresDependencyResolution runtime
+37 */
+38publicclassUpdateMojoextendsAbstractSchemaMojo
+39 {
+40/**
+41 * Output file.
+42 * <p>
+43 * If the specified filename is not absolut, the file will be created
+44 * relative to the project build directory
+45 * (<code>project.build.directory</code>).
+46 *
+47 * @parameter property="hibernate.schema.update" default-value="update.sql"
+48 * @since 1.0
+49 */
+50private String outputFile;
+51
+52
+53 @Override
+54publicfinalvoid execute()
+55throws
+56 MojoFailureException,
+57 MojoExecutionException
+58 {
+59super.execute(outputFile);
+60 }
+61
+62
+63 @Override
+64void build(
+65 MetadataImplementor metadata,
+66 ExecutionOptions options,
+67 TargetDescriptor target
+68 )
+69throws
+70 MojoExecutionException,
+71 MojoFailureException
+72 {
+73 ServiceRegistry service =
+74 metadata.getMetadataBuildingOptions().getServiceRegistry();
+75 SchemaManagementTool tool = service.getService(SchemaManagementTool.class);
+76
+77 Map config = options.getConfigurationValues();
+78
+79 tool.getSchemaMigrator(config).doMigration(metadata, options, target);
+80 }
+81 }
+