I got a ant build.xml invoked properly via maven antrun plugin but when i
define it inline, it doesn't work. Please assist.
I think it has to do with xmlns but not sure where to define it properly.
(To be specific am using a jacoco ant task for code coverage as described
here <http://www.eclemma.org/jacoco/trunk/doc/ant.html>)

The error that i got is

*[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-antrun-plugin:1.6:
run (default) on project xxx.sample.suite: An Ant BuildException has occure
d: The prefix "jacoco" for element "jacoco:report" is not bound. -> [Help 1]
*

<?xml version="1.0" encoding="UTF-8"?>
<project
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd";
    xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance";
*    xmlns:jacoco="antlib:org.jacoco.ant">*
    <modelVersion>4.0.0</modelVersion>

    <groupId>xxx.sample</groupId>
    <artifactId>xxx.sample.suite</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <configuration>

                            <target>

                             <taskdef uri="antlib:org.jacoco.ant"
resource="org/jacoco/ant/antlib.xml">
                                    <classpath

path="C:\SOFTWARES\JAVA\Java-external-jars\Jacoco\lib\jacocoant.jar" />
                            </taskdef>

                                <echo message="Base dir: ${basedir}" />


                                    <jacoco:report>

                                        <executiondata>
                                            <file file="C:/coverage.exec" />
                                        </executiondata>

                                        <structure name="Example Project">
                                            <classfiles>
                                                <fileset
                                                    dir="C:\..\bin" />
                                            </classfiles>
                                            <sourcefiles encoding="UTF-8">
                                                <fileset
                                                    dir="C:\..\src" />
                                            </sourcefiles>
                                        </structure>

                                        <html destdir="C:/report" />

                                    </jacoco:report>
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>
</project>

Thanks,
Hari

Reply via email to