前缀“声纳"对于元素“声纳:声纳";不受约束 [英] The prefix "sonar" for element "sonar:sonar" is not bound

查看:38
本文介绍了前缀“声纳"对于元素“声纳:声纳";不受约束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个如下所示的 build.xml 文件:

I have a build.xml-file that looks something like this:

<taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml" classpath="/path/sonar-ant-task.jar"/>

<target name="sonar">       
    <sonar:sonar/>
</target>

当我运行文件时,我得到:

And when I run the file I get:

The prefix "sonar" for element "sonar:sonar" is not bound.

我遗漏了什么明显的东西?

Any obvious things I'm missing?

推荐答案

您在 Ant 脚本的顶部 project 元素中缺少命名空间声明.

You're missing the namespace declaration in the top project element of your Ant script.

xmlns:sonar="antlib:org.sonar.ant" 应该这样做.

这篇关于前缀“声纳"对于元素“声纳:声纳";不受约束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆