Filtering should handle java.io.File values
-------------------------------------------

         Key: MRESOURCES-10
         URL: http://jira.codehaus.org/browse/MRESOURCES-10
     Project: Maven 2.x Resources Plugin
        Type: Improvement

    Reporter: Mike Perham


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:

{code:xml}
  <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>
{code}

But I'd like to do this:

{code:xml}
  <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>
{code}

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)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to