erikandersen-pariveda / fluint

Automatically exported from code.google.com/p/fluint
0 stars 0 forks source link

Ant Task getDirectoryScanner Failed with Maven 2.0.9 #21

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Write an ant script (build.xml) to invoke the Fluint Ant target.
2. Specify the FileSet element.
3. Invoke the ant script from Maven 2.0.9

Maven failed complaining that method not found on FileSet::getDirectoryScanner

The problem is Maven expects the project reference, but the Ant task is not
passing it:

<before>
    DirectoryScanner ds = fs.getDirectoryScanner();
<after>
        DirectoryScanner ds = fs.getDirectoryScanner(getProject());

I changed the code to pass the getProject() and build my own fluintAnt.jar
and the problem goes away.

build.xml

    <target name="test-flex">

        <echo message="Running Flex Unit Tests under: ${OUTPUT_DIR}..."/>

                <fluint
                        debug="true"
                        headless="true"
                        testRunner="C:\Program
Files\FluintAIRTestRunner\FluintAIRTestRunner.exe"
            outputDir="${OUTPUT_DIR}">

            <fileset dir="${OUTPUT_DIR}">
                <include name="**/*TestModule.swf"/>
                        </fileset>
        </fluint>

    </target>

********** pom.xml **************

            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                    <executions>
                        <execution>
                        <phase>test</phase>
                           <id>flexunit-tasks</id>
                           <configuration>
                               <tasks>
                                    <property name="OUTPUT_DIR" value="${project.build.directory}"/>
                                    <property name="SOURCE_DIR" value="${basedir}/Reference"/>
                                    <property name="MAVEN_REPO" value="${settings.localRepository}"/>
                                    <ant antfile="${basedir}/build.xml" inheritRefs="true">
                                        <target name="test-flex"/>
                                    </ant>
                                </tasks>
                            </configuration>
                            <goals>
                                <goal>run</goal>
                            </goals>
                        </execution>
                    </executions>
            </plugin>

Original issue reported on code.google.com by am...@comcast.net on 14 Nov 2008 at 10:21

GoogleCodeExporter commented 8 years ago
This is problem with the dependencies that the Fluint Ant task has on Ant 1.7.0 
from
what I can tell.  By default the maven-ant-run plugin uses Ant 1.6.5.  Here is 
the
snippet I added under <plugin> for the maven-ant-run plugin to fix the issue:

<dependencies>
   <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant</artifactId>
      <version>1.7.0</version>
   </dependency>
</dependencies>

I was able to call the fluint task directly after I got it all working.  I 
wrote a
post about it @
http://www.brianlegros.com/blog/2008/12/17/continuous-integration-with-maven-fle
x-fliunt-and-hudson/.

Hope this helps.

Original comment by legrosb@gmail.com on 17 Dec 2008 at 6:07

GoogleCodeExporter commented 8 years ago
Haven't heard anything back, this is working for me, so I'm going to close.

Original comment by legrosb@gmail.com on 12 Feb 2009 at 2:24