[
https://jira.codehaus.org/browse/MSQL-64?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Robert Scholte closed MSQL-64.
------------------------------
Resolution: Cannot Reproduce
Assignee: Robert Scholte
I've added an integration-test, just to be absolutely sure that it *_does_*
work.
See [rev. 14464|http://fisheye.codehaus.org/changelog/mojo/?cs=14464]
> Files[] type produces NPE (should be replaced by ArrayList<java.io.File>)
> --------------------------------------------------------------------------
>
> Key: MSQL-64
> URL: https://jira.codehaus.org/browse/MSQL-64
> Project: Maven 2.x SQL Plugin
> Issue Type: Bug
> Affects Versions: 1.4
> Reporter: Martin Gainty
> Assignee: Robert Scholte
>
> Guys
> I could not get this plugin.xml to work
> debug statements display NPEs on any/all references to parameter srcFiles
> I discovered the srcFiles array is not initted and not allocated
> Source file: org.codehaus.mojo.sql.SqlExecMojo
> {noformat}
> <parameter>
> <name>srcFiles</name>
> <type>java.io.File[]</type>
> <required>false</required>
> <editable>true</editable>
> <description>List of files containing SQL statements to
> load.</description>
> </parameter>
> {noformat}
> One solution is to refactor the array to use ArrayList<java.io.File>
> and reconfig on pluginXml to implement java.util.ArrayList<java.io.File> does
> work (at least for me)
> {noformat}
> <parameter>
> <name>srcFiles</name>
> <type>java.util.ArrayList</type>
> <required>false</required>
> <editable>true</editable>
> <description>List of files containing SQL statements to
> load.</description>
> </parameter>
> {noformat}
> pom.xml test harness
> {noformat}
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>sql-maven-plugin-test</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> <build>
> <plugins>
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>sql-maven-plugin</artifactId>
> <version>1.4</version>
> <dependencies>
> <!-- put oracle drivers (org.jdbc.driver.oracleDriver) in this artifact
> -->
> <dependency>
> <groupId>org.jdbc</groupId>
> <artifactId>oracle</artifactId>
> <version>1.4</version>
> </dependency>
> </dependencies>
> <configuration>
> <driver>oracle.jdbc.driver.OracleDriver</driver>
> <url>jdbc:thin://localhost:1521/comm2servlet</url>
> <username>system</username>
> <password>password</password>
> <skip>${maven.test.skip}</skip>
> <!-- sqlCommand>select ${one} FROM SYSIBM.SYSDUMMY1;</sqlCommand -->
> <!-- enableFiltering>true</enableFiltering -->
> <srcFiles>
> <srcFile>src/main/sql/sql1.sql</srcFile>
> <srcFile>src/main/sql/sql2.sql</srcFile>
> </srcFiles>
> </configuration>
> </plugin>
> </plugins>
> </build>
> <properties>
> <one>1</one>
> </properties>
>
> </project>
> {noformat}
> /src/main/sql/sql1.sql
> {noformat}
> select SYSDATE FROM DUAL;
> {noformat}
> /src/main/sql/sql2.sql
> {noformat}
> select * from V$PARAMETER WHERE name='sql_version';
> {noformat}
> Thanks
> Martin
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email