Toggle navigation
Toggle navigation
This project
Loading...
Sign in
grogv3
/
grog-cubi
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
JR Utily
2017-04-23 10:46:14 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
67b79b9b794a2c8f830d195e80013634edc7088c
67b79b9b
1 parent
55bd2ecd
duplicate persistence.xml, and choose only one at building time with maven profile
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
126 additions
and
55 deletions
grog-entities/pom.xml
grog-entities/src/main/resources/META-INF/persistence-integration.xml
grog-entities/src/main/resources/META-INF/persistence-production.xml
grog-entities/src/main/resources/META-INF/persistence.xml
grog-entities/pom.xml
View file @
67b79b9
...
...
@@ -19,6 +19,9 @@
<hibernate-commons-annotations.version>
5.0.1.Final
</hibernate-commons-annotations.version>
<hibernate-jpa-2.1-api.version>
1.0.0.Final
</hibernate-jpa-2.1-api.version>
<solr.version>
6.3.0
</solr.version>
<!-- Default is production/mysql -->
<persistence.xml.filepath>
persistence-production.xml
</persistence.xml.filepath>
</properties>
...
...
@@ -99,8 +102,79 @@
</dependencies>
<profiles>
<profile>
<id>
DS-h2-embeded
</id>
<!--
When building for Integration, use the integration persistence.xml
-->
<properties>
<persistence.xml.filepath>
persistence-integration.xml
</persistence.xml.filepath>
</properties>
</profile>
<!--
MySQL is default, so nothing to do for this profile
<profile>
<id>DS-mysql-local</id>
</profile>
-->
</profiles>
<build>
<resources>
<resource>
<directory>
src/main/resources
</directory>
<excludes>
<exclude>
**/persistence-*.xml
</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>
maven-clean-plugin
</artifactId>
<configuration>
<filesets>
<fileset>
<directory>
src/main/resources/META-INF/
</directory>
<includes>
<include>
persistence.xml
</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>
com.coderplus.maven.plugins
</groupId>
<artifactId>
copy-rename-maven-plugin
</artifactId>
<version>
1.0.1
</version>
<executions>
<execution>
<id>
copy-file
</id>
<phase>
generate-resources
</phase>
<goals>
<goal>
copy
</goal>
</goals>
<configuration>
<sourceFile>
src/main/resources/META-INF/${persistence.xml.filepath}
</sourceFile>
<destinationFile>
src/main/resources/META-INF/persistence.xml
</destinationFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-jar-plugin
</artifactId>
...
...
grog-entities/src/main/resources/META-INF/persistence-integration.xml
0 → 100644
View file @
67b79b9
<?xml version="1.0" encoding="UTF-8"?>
<persistence
version=
"2.0"
xmlns=
"http://java.sun.com/xml/ns/persistence"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
>
<!--
INTEGRATION PERSISTENCE UNIT AIMED TO BE USED WITH H2 DB
-->
<persistence-unit
name=
"Grog-DB"
transaction-type=
"JTA"
>
<provider>
org.hibernate.jpa.HibernatePersistenceProvider
</provider>
<jta-data-source>
GrogDatabase
</jta-data-source>
<exclude-unlisted-classes>
false
</exclude-unlisted-classes>
<properties>
<property
name=
"hibernate.hbm2ddl.auto"
value=
"create"
/>
<property
name=
"hibernate.hbm2ddl.import_files"
value=
"import.sql"
/>
<property
name=
"hibernate.hbm2ddl.import_files_sql_extractor"
value=
"org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor"
/>
<!-- DDL control OFF
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
-->
</properties>
</persistence-unit>
</persistence>
\ No newline at end of file
grog-entities/src/main/resources/META-INF/persistence-production.xml
0 → 100644
View file @
67b79b9
<?xml version="1.0" encoding="UTF-8"?>
<persistence
version=
"2.0"
xmlns=
"http://java.sun.com/xml/ns/persistence"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
>
<!--
PRODUCTION PERSISTENCE UNIT AIMED TO BE USED WITH MYSQL DB
-->
<persistence-unit
name=
"Grog-DB"
transaction-type=
"JTA"
>
<provider>
org.hibernate.jpa.HibernatePersistenceProvider
</provider>
<jta-data-source>
GrogDatabase
</jta-data-source>
<exclude-unlisted-classes>
false
</exclude-unlisted-classes>
<properties>
<property
name=
"hibernate.connection.CharSet"
value=
"utf8"
/>
<property
name=
"hibernate.connection.characterEncoding"
value=
"utf8"
/>
<property
name=
"hibernate.connection.useUnicode"
value=
"true"
/>
<!-- DDL control OFF
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
-->
</properties>
</persistence-unit>
</persistence>
\ No newline at end of file
grog-entities/src/main/resources/META-INF/persistence.xml
deleted
100644 → 0
View file @
55bd2ec
<?xml version="1.0" encoding="UTF-8"?>
<persistence
version=
"2.0"
xmlns=
"http://java.sun.com/xml/ns/persistence"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
>
<persistence-unit
name=
"development-pu"
transaction-type=
"JTA"
>
<provider>
org.hibernate.jpa.HibernatePersistenceProvider
</provider>
<jta-data-source>
H2Database
</jta-data-source>
<exclude-unlisted-classes>
false
</exclude-unlisted-classes>
<properties>
<property
name=
"hibernate.hbm2ddl.auto"
value=
"create"
/>
<property
name=
"hibernate.hbm2ddl.import_files"
value=
"import.sql"
/>
<property
name=
"hibernate.hbm2ddl.import_files_sql_extractor"
value=
"org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor"
/>
<!-- DDL control OFF
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
-->
</properties>
</persistence-unit>
<persistence-unit
name=
"migration-pu"
transaction-type=
"JTA"
>
<provider>
org.hibernate.jpa.HibernatePersistenceProvider
</provider>
<jta-data-source>
migrationDatabase
</jta-data-source>
<exclude-unlisted-classes>
false
</exclude-unlisted-classes>
<properties>
<property
name=
"hibernate.connection.CharSet"
value=
"utf8"
/>
<property
name=
"hibernate.connection.characterEncoding"
value=
"utf8"
/>
<property
name=
"hibernate.connection.useUnicode"
value=
"true"
/>
<property
name=
"hibernate.hbm2ddl.auto"
value=
"create-drop"
/>
<property
name=
"hibernate.hbm2ddl.import_files"
value=
"nothing.sql"
/>
<property
name=
"hibernate.hbm2ddl.import_files_sql_extractor"
value=
"org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor"
/>
<!-- DDL control OFF
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
-->
</properties>
</persistence-unit>
<persistence-unit
name=
"production-pu"
transaction-type=
"JTA"
>
<provider>
org.hibernate.jpa.HibernatePersistenceProvider
</provider>
<jta-data-source>
productionDatabase
</jta-data-source>
<exclude-unlisted-classes>
false
</exclude-unlisted-classes>
<properties>
<property
name=
"hibernate.connection.CharSet"
value=
"utf8"
/>
<property
name=
"hibernate.connection.characterEncoding"
value=
"utf8"
/>
<property
name=
"hibernate.connection.useUnicode"
value=
"true"
/>
<property
name=
"javax.persistence.hibernate.hbm2ddl.import_files"
value=
""
/>
<property
name=
"hibernate.hbm2ddl.import_files_sql_extractor"
value=
"org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor"
/>
<!-- DDL control OFF
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
-->
</properties>
</persistence-unit>
</persistence>
\ No newline at end of file
Please
register
or
login
to post a comment