'copyfiles' 是标准的 ant 任务吗? [英] Is 'copyfiles' a standard ant task?

查看:27
本文介绍了'copyfiles' 是标准的 ant 任务吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 NetBeans 项目,我正在尝试从命令行 ant 手动编译该项目.在安装了 NetBeans 的同一台机器上运行时,它可以完美运行.

I have a NetBeans project that I'm trying to compile manually from command-line ant. When running on the same machine that has NetBeans installed, it works flawlessly.

但是,如果我在中央持续集成服务器(未安装 NetBeans)上运行 ant,它会在 任务上失败:

However, if I run ant on a central continuous integration server (no NetBeans installed) it fails on a <copyfiles> task:

BUILD FAILED
/var/lib/jenkins/workspace/project_name/nbproject/build-impl.xml:697: Problem: failed to create task or type copyfiles
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

目标在自动生成的 build-impl.xml 中,它看起来像这样:

The target is in the auto-generated build-impl.xml, which looks something like this:

<target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
    <copyfiles files="${file.reference.some_dependency.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
</target>

当我查看 ant 手册时,copyfiles 是甚至不是一个合适的蚂蚁任务.怎么了?

When I look at the ant manual, copyfiles isn't even a proper ant task. So what's up?

我怎样才能让它在没有安装 NetBeans 的机器上运行?

How can I get this to run on a machine with no NetBeans installation?

推荐答案

根据 这个建议,我验证了依赖项,实际上 lib/CopyLibs 目录在我们的源代码控制库中没有 版本化.这就是为什么我的本地环境能够编译,而 CI 服务器却不能.

Per this advice, I verified the dependencies, and indeed the lib/CopyLibs directory was not versioned in our source control repo. That's why my local environment was able to compile, but the CI server wasn't.

在类路径中添加依赖项 - org-netbeans-modules-java-j2seproject-copylibstask.jar 之后 - ant 构建成功.

After adding the dependency to the classpath - org-netbeans-modules-java-j2seproject-copylibstask.jar specifically - the ant build succeeded.

就我个人而言,我觉得 NetBeans 需要外部依赖来执行一项任务是荒谬的,而该任务 - 微不足道 - 作为标准 ant 任务存在.

On a personal note, I find it absurd that NetBeans needs an external dependency for a task that - trivially - exists as a standard ant task.

这篇关于'copyfiles' 是标准的 ant 任务吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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