Hi,
I'm trying to use the ant-run plugin to execute a sql script as part of my
build.
It's working perfectly, as long as I build the project directly. If I try
to built the project as a module from a parent pom, the plugin fails with
the error:
"Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/derby/tools/ij"
Does anyone know what's wrong? Any help would be greatly appreciated.
The parent pom doesn't contain anything other than module definitions and
some surefire configuration. Here's the relevant part of the project's pom
though:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create-demo-database</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<java classpathref="maven.plugin.classpath"
classname="org.apache.derby.tools.ij"
fork="true"
dir="${project.build.directory}">
<arg
value="${project.basedir}/database/create-database.sql" />
</java>
</tasks>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
<version>10.4.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.4.2.0</version>
</dependency>
</dependencies>
</plugin>
Thanks,
Dave.