maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anders Hammar <and...@hammar.net>
Subject Re: Inline Ant tasks not working - Namespace problem?
Date Tue, 02 Nov 2010 10:13:00 GMT
http://maven.apache.org/plugins/maven-antrun-plugin/examples/customTasks.html

You need to define a plugin dependency to jacocoant.jar. If that artifact is
not already in the repo, you need to ad it to your repo manager.

/Anderfs

On Tue, Nov 2, 2010 at 10:59, Hari shankar <harshan87@gmail.com> wrote:

> 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
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message