我可以在 Ant 中使用远程构建文件吗?
我有一个由我们公司的前员工创建的 Ant 脚本,它包含从 Subversion 检查项目的任务。我遇到的唯一问题是构建文件实际上是 subversion 中项目的一部分。因此,为了使用该脚本,我首先必须签出该项目,以便我在本地拥有 build.xml 文件的副本。
是否有可能将 ant 指向颠覆存储库中的远程文件?例如:
ant -f svn+ssh://path/to/build.xml
我尝试了这样的方法,但它不喜欢它,但我想知道是否还有其他方法可以做到这一点?
I have an ant script created by a previous employee of our company and it contains tasks to check projects out of Subversion. The only problem I have though is that the build file is actually part of a project in subversion. So in order to use the script I first have to checkout that project so that I have a copy of the build.xml file locally.
Is it possible at all to point ant to a remote file in a subversion repository? e.g.:
ant -f svn+ssh://path/to/build.xml
I tried it like this and it doesn't like it, but I was wondering if there was another way of doing it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据消息来源,这是不可能的,因为
-f
参数用于构造一个普通的旧java.io.File
—没有花哨的网络访问或 SVN 集成。您能否在本地保留该存储库的签出,或者在您的类路径中保存该自定义 Ant 任务的副本,因为它可能不会经常更改?
According to the source, this is not possible because the
-f
parameter is used to construct a plain oldjava.io.File
— no fancy network access or SVN integration.Can you not keep a checkout of that repo locally, or copy of that custom Ant Task in your classpath, as presumably its unlikely to change often?
您可以使用
任务在build.xml
中导入本地或远程构建文件。请参阅此问题:如何在项目之间最好地共享 Ant 目标?
You could use the
<Import>
task to import a local or remote build file in yourbuild.xml
.See this question : How can I best share Ant targets between projects?