Hudson 持续集成服务器:如何查看对 Ant 可见的 Windows 映射目录? [英] Hudson continuous integration server: how to see Windows mapped directories that are visible to Ant?

查看:36
本文介绍了Hudson 持续集成服务器:如何查看对 Ant 可见的 Windows 映射目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Hudson、Ant 1.7、Tomcat 6.20、JDK 1.6 和 JDK 1.5;全部在 Windows 机器上.

Using Hudson, Ant 1.7, Tomcat 6.20, JDK 1.6 and JDK 1.5; all on Windows boxes.

我的 WAR 文件的 Ant 构建脚本使用存储在远程服务器上的 JAR.远程服务器的目录路径在 Windows 中映射为网络驱动器.build.properties 文件用于指定 JAR 依赖项的路径.使用 Ant 构建时,无论是在命令行还是在 Eclipse 中,WAR 都会成功构建和部署.

My Ant build script for a WAR file uses JARs stored on a remote server. The directory path to the remote server is mapped as a network drive in Windows. A build.properties file is used to specify the paths to the JAR dependencies. When building with Ant, either at command line or in Eclipse, the WAR builds and deploys successfully.

来自 build.properties 的示例:

Example from build.properties:

lib.log4j=S:/Support/JARs/log4j-1.2.15.jar

lib.log4j=S:/Support/JARs/log4j-1.2.15.jar

在上面的条目中,Windows 中映射的网络驱动器是S"驱动器.

In the above entry, the mapped network drive in Windows is the "S" drive.

我目前正在本地工作站上评估 Hudson.在 Hudson 中,如果我尝试使用 JAR 的映射网络驱动器路径,构建将失败.如果我将 JAR 复制到本地目录(以便它们位于 C:/Support/JAR 中),则构建将成功编译和创建 WAR.

I am currently evaluating Hudson on my local workstation. In Hudson, if I attempt to use the mapped network drive path to the JARs, the build fails. If I copy over the JARs to a local directory (so that they are in C:/Support/JARs), the build succeeds in compiling and creating the WAR.

如何让 Hudson 尊重映射的网络驱动器路径?另外,有没有办法避免在 Hudson 用户界面中传递 Ant 参数,而是实际使用 build.properties 文件?Hudson 似乎无法读取 build.properties,否则.

How can I get Hudson to respect the mapped network drive paths? Also, is there a way to avoid having to pass Ant arguments in the Hudson user interface, and instead actually use the build.properties file, instead? Hudson seems unable to read the build.properties, otherwise.

非常感谢.

迈克昆特尔

推荐答案

我假设您将 hudson 作为 Windows 服务运行.服务环境与普通用户有些不同,例如它具有极少的网络特权或没有网络特权.此外,驱动器映射发生在登录期间,并且特定于用户会话 - 因此服务无法真正看到这些驱动器,因为在用户注销并取消映射驱动器后,这些服务可能仍需要运行.

I assume you're running hudson as a windows service. The service environment is somewhat different to a normal user, for instance it will have minimal or no network priveleges. Also, drive mapping happens during logon and is specific to the user session - so services can't really see these drives, as the services may still need to run after the user has logged off and the drives unmapped.

您可以尝试将 hudson 服务配置为使用具有网络特权的帐户,并将构建脚本更改为使用 UNC 路径(\server 类型路径)

You can try configuring the hudson service to use an account with network priveleges, and change the build scripts to use UNC paths (\server type paths)

另一种选择是在从登录的用户帐户运行的从属中进行构建.它会工作,但很讨厌.

The other alternative is to do builds in slaves which are running from a logged in user account. It'll work, but it's nasty.

一些包含有用信息的链接:

Some links with useful info:

  1. 信息:服务和重定向驱动器
  2. 创建 Windows 服务时的一些最佳做法的说明

这篇关于Hudson 持续集成服务器:如何查看对 Ant 可见的 Windows 映射目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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