Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
I'm trying to use filters along with ${basedir} to setup my unit test Derby database. Derby must have a unique directory to build its database in and this becomes a problem in multi-module builds.
Currently I'm doing this:
<bean id="wsf.storage.dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName"><value>org.apache.derby.jdbc.EmbeddedDriver</value></property> <property name="url"><value>jdbc:derby:target/test/testdb/${pom.artifactId};create=true</value></property> </bean>
But I'd like to do this:
<bean id="wsf.storage.dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName"><value>org.apache.derby.jdbc.EmbeddedDriver</value></property> <property name="url"><value>jdbc:derby:${basedir}/target/test/testdb;create=true</value></property> </bean>
When I try to do the latter, I get this:
java.lang.ClassCastException: java.io.File
at org.codehaus.plexus.util.InterpolationFilterReader.read(InterpolationFilterReader.java:269)
at org.codehaus.plexus.util.InterpolationFilterReader.read(InterpolationFilterReader.java:162)
at java.io.Reader.read(Reader.java:100)
at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:212)
at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:200)
at org.apache.maven.plugin.resources.ResourcesMojo.copyFile(ResourcesMojo.java:249)
at org.apache.maven.plugin.resources.ResourcesMojo.copyResources(ResourcesMojo.java:172)
at org.apache.maven.plugin.resources.TestResourcesMojo.execute(TestResourcesMojo.java:53)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
Attachments
Issue Links
- is depended upon by
-
MWAR-12 Add resource filtering to war plugin
- Closed
- is duplicated by
-
MRESOURCES-19 classcastexception when filtering a test resource with a ${basedir} defined
- Closed