Adding default H2 database related file contents to be packed during the phase where the final distribution is created

4.x.x
prabathabey 10 years ago
parent 07e3dc9644
commit b331f708dd

@ -98,6 +98,40 @@
<artifactId>maven-antrun-plugin</artifactId>
<!--<version>${maven-antrun-plugin.version}</version>-->
<executions>
<execution>
<!-- Creating Device Management schema -->
<id>create-device-mgt-schema</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo
message="########### Create Device Management H2 Schema ###########"/>
<property name="db.dir"
value="target/wso2carbon-core-${carbon.kernel.version}/repository/database"/>
<property name="userid" value="wso2carbon"/>
<property name="password" value="wso2carbon"/>
<property name="dbURL"
value="jdbc:h2:file:${basedir}/${db.dir}/WSO2DM_DB;DB_CLOSE_ON_EXIT=FALSE"/>
<sql driver="org.h2.Driver"
url="${dbURL}"
userid="${userid}" password="${password}"
autocommit="true" onerror="continue">
<classpath refid="maven.dependency.classpath"/>
<classpath refid="maven.compile.classpath"/>
<classpath refid="maven.runtime.classpath"/>
<fileset file="${basedir}/../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/dbscripts/cdm/h2.sql"/>
</sql>
<echo
message="##################### END ####################"/>
</tasks>
</configuration>
</execution>
<execution>
<!-- Creating IDP Management schema -->
<id>create-idp-mgt-schema</id>

@ -208,10 +208,10 @@
</includes>
</fileSet>
<!-- Script -->
<!-- Copying Device Management related dbscripts -->
<fileSet>
<directory>src/repository/dbscripts/</directory>
<outputDirectory>wso2cdm-${project.version}/dbscripts</outputDirectory>
<directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/dbscripts/cdm</directory>
<outputDirectory>wso2cdm-${project.version}/dbscripts/cdm</outputDirectory>
<includes>
<include>*/**</include>
</includes>
@ -443,12 +443,22 @@
<!-- Copying H2 database related files corresponding to default API management repository schema -->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/database/WSO2AM_DB.h2.db
target/wso2carbon-core-${carbon.kernel.version}/repository/database/WSO2AM_DB.h2.db
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/database</outputDirectory>
<destName>WSO2AM_DB.h2.db</destName>
<fileMode>644</fileMode>
</file>
<!-- Copying H2 database related files corresponding to default Device management repository schema -->
<file>
<source>
target/wso2carbon-core-${carbon.kernel.version}/repository/database/WSO2DM_DB.h2.db
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/database</outputDirectory>
<destName>WSO2DM_DB.h2.db</destName>
<fileMode>644</fileMode>
</file>
</files>
</assembly>

Loading…
Cancel
Save