Uploaded image for project: 'Schematron Validator'
  1. Schematron Validator
  2. SCHVAL-174

Extract datasource configuration

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.1
    • Fix Version/s: 2.5.0
    • Labels:
      None
    • Account:
      Maintenance 2019 (MAINTENANCE2019)

      Description

      Extract the datasource configuration from the EAR file.

      1.1 - Remove these properties of persistence.xml (and hibernate.cfg.xml if exists):
                  <property name="hibernate.connection.url" value="${jdbc.connection.url}"/>
                  <property name="hibernate.connection.username" value="${jdbc.user}"/>
                  <property name="hibernate.connection.password" value="${jdbc.password}"/>
                  <property name="hibernate.connection.provider_class" value="org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider"/>
      1.2 - Add this property to persistence.xml (and hibernate.cfg.xml if exists):
                   <property name="hibernate.connection.datasource" value="JBOSS/DATASOURCE/PATH"/>
      JBOSS/DATASOURCE/PATH is the jndi-name defined in the datasource configuration file.

      2 - Create zip containing the datasource file:
        2.1 - In the pom.xml file of the ear, if the maven-assembly-plugin is set, add
      <descriptor>src/main/assembly/datasource.xml</descriptor>
       otherwise add the plugin :
                              <plugin>
      <artifactId>maven-assembly-plugin</artifactId>
      <version>2.2.1</version>
      <configuration>
      <descriptors>
      <descriptor>src/main/assembly/datasource.xml</descriptor>
      </descriptors>
      </configuration>
      <executions>
      <execution>
      <id>make-assembly</id>
      <phase>package</phase>
      <goals>
      <goal>single</goal>
      </goals>
      </execution>
      </executions>
      </plugin>
        2.2 - Create the 'src/main/assembly' folder if doesn't exist and create the datasource.xml file into this folder with the following content:
      <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
          <id>datasource</id>
          <baseDirectory>/</baseDirectory>
          <formats>
              <format>zip</format>
          </formats>
          <fileSets>
              <fileSet>
                  <directory>src/main/datasource</directory>
                  <outputDirectory>/</outputDirectory>
              </fileSet>
          </fileSets>
      </assembly>
        2.3 - Create the folder 'src/main/datasource' and move the datasource configuration file from 'src/main/application/META-INF' to 'src/main/datasource'

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                marif Maxime ARIF
                Reporter:
                marif Maxime ARIF
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 20 minutes
                  20m

                    Potential Duplicates