Author: jeff.yuchang
Date: 2010-01-09 08:50:37 -0500 (Sat, 09 Jan 2010)
New Revision: 448
Modified:
branches/ODE/ODE-2.0-maven/dao-hibernate-db/build.xml
branches/ODE/ODE-2.0-maven/dao-hibernate-db/pom.xml
branches/ODE/ODE-2.0-maven/dao-jpa-db/build.xml
branches/ODE/ODE-2.0-maven/dao-jpa-db/pom.xml
branches/ODE/ODE-2.0-maven/pom.xml
Log:
* using sql-maven-plugin instead of sql ant task.
Modified: branches/ODE/ODE-2.0-maven/dao-hibernate-db/build.xml
===================================================================
--- branches/ODE/ODE-2.0-maven/dao-hibernate-db/build.xml 2010-01-09 09:36:03 UTC (rev
447)
+++ branches/ODE/ODE-2.0-maven/dao-hibernate-db/build.xml 2010-01-09 13:50:37 UTC (rev
448)
@@ -59,20 +59,7 @@
</target>
- <target name="create-derby-db">
- <property name="dblocation"
value="${basedir}/target/derby/hibdb" />
- <sql
- driver="org.apache.derby.jdbc.EmbeddedDriver"
- url="jdbc:derby:${dblocation};create=true"
- userid="sa"
- password=""
- autocommit="yes"
- >
- <transaction src="${basedir}/target/derby.sql"/>
- <classpath>
- <path refid="classpath"/>
- </classpath>
- </sql>
+ <target name="zip-derby-db">
<zip
destfile="${basedir}/target/ode-dao-hibernate-db-${ode.version}.zip"
basedir="${basedir}/target/derby/" />
</target>
Modified: branches/ODE/ODE-2.0-maven/dao-hibernate-db/pom.xml
===================================================================
--- branches/ODE/ODE-2.0-maven/dao-hibernate-db/pom.xml 2010-01-09 09:36:03 UTC (rev 447)
+++ branches/ODE/ODE-2.0-maven/dao-hibernate-db/pom.xml 2010-01-09 13:50:37 UTC (rev 448)
@@ -75,9 +75,7 @@
<configuration>
<tasks>
<property name="maven.runtime.classpath"
refid="maven.compile.classpath"/>
- <property name="ode.version"
value="${ode.version}" />
<ant antfile="build.xml" target="create-schema"
inheritRefs="true"/>
- <!--ant antfile="build.xml"
target="create-derby-db" /-->
</tasks>
</configuration>
<goals>
@@ -86,6 +84,48 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sql-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>create-derby-db</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+
<url>jdbc:derby:${basedir}/target/derby/jpadb;create=true</url>
+ <username>sa</username>
+ <password />
+ <autocommit>true</autocommit>
+ <onError>continue</onError>
+ <srcFiles>
+ <srcFile>target/derby.sql</srcFile>
+ </srcFiles>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>zip-derby-db</id>
+ <phase>package</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="ode.version"
value="${project.version}"/>
+ <ant antfile="build.xml" target="zip-derby-db" />
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
Modified: branches/ODE/ODE-2.0-maven/dao-jpa-db/build.xml
===================================================================
--- branches/ODE/ODE-2.0-maven/dao-jpa-db/build.xml 2010-01-09 09:36:03 UTC (rev 447)
+++ branches/ODE/ODE-2.0-maven/dao-jpa-db/build.xml 2010-01-09 13:50:37 UTC (rev 448)
@@ -48,22 +48,8 @@
</target>
- <target name="create-derby-db">
- <property name="dblocation"
value="${basedir}/target/derby/jpadb" />
- <sql
- driver="org.apache.derby.jdbc.EmbeddedDriver"
- url="jdbc:derby:${dblocation};create=true"
- userid="sa"
- password=""
- autocommit="yes"
- >
- <transaction src="${basedir}/target/derby.sql"/>
- <classpath>
- <path refid="classpath"/>
- </classpath>
- </sql>
- <zip destfile="${basedir}/target/ode-dao-jpa-db-${ode.version}.zip"
basedir="${basedir}/target/derby/" />
-
+ <target name="zip-derby-db">
+ <zip destfile="${basedir}/target/ode-dao-jpa-db-${ode.version}.zip"
basedir="${basedir}/target/derby" />
</target>
<!--
Modified: branches/ODE/ODE-2.0-maven/dao-jpa-db/pom.xml
===================================================================
--- branches/ODE/ODE-2.0-maven/dao-jpa-db/pom.xml 2010-01-09 09:36:03 UTC (rev 447)
+++ branches/ODE/ODE-2.0-maven/dao-jpa-db/pom.xml 2010-01-09 13:50:37 UTC (rev 448)
@@ -159,14 +159,56 @@
<configuration>
<tasks>
<property name="maven.runtime.classpath"
refid="maven.compile.classpath"/>
- <property name="ode.version"
value="${ode.version}"/>
<ant antfile="build.xml" target="create-schema"
/>
- <!--ant antfile="build.xml" target="create-derby-db" /-->
</tasks>
</configuration>
</execution>
</executions>
</plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sql-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>create-derby-db</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+
<url>jdbc:derby:${basedir}/target/derby/jpadb;create=true</url>
+ <username>sa</username>
+ <password />
+ <autocommit>true</autocommit>
+ <onError>continue</onError>
+ <srcFiles>
+ <srcFile>target/derby.sql</srcFile>
+ </srcFiles>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>zip-derby-db</id>
+ <phase>package</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="ode.version"
value="${project.version}"/>
+ <ant antfile="build.xml" target="zip-derby-db" />
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
</plugins>
</build>
Modified: branches/ODE/ODE-2.0-maven/pom.xml
===================================================================
--- branches/ODE/ODE-2.0-maven/pom.xml 2010-01-09 09:36:03 UTC (rev 447)
+++ branches/ODE/ODE-2.0-maven/pom.xml 2010-01-09 13:50:37 UTC (rev 448)
@@ -138,7 +138,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-beta-3</version>
+ <version>2.2-beta-5</version>
</plugin>
<plugin>
@@ -182,6 +182,24 @@
<version>2.3.3</version>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sql-maven-plugin</artifactId>
+ <version>1.2</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>${derby.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derbytools</artifactId>
+ <version>${derby.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
<!-- Allows direct usage of the javadoc:javadoc goal. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>