蚂蚁没有加载salesforce任务定义吗? [英] Ant not loading salesforce task definitions?
问题描述
问题
我正在尝试在Linux机器上使用Force.com迁移工具(自定义的蚂蚁库),但我一辈子都无法弄清楚如何让蚂蚁看到该库.我在做什么错了?
I'm trying to use the Force.com Migration Tool (a custom ant library) on a linux box and can't for the life of me figure out how to get ant to see that library. What am I doing wrong?
错误消息
BUILD FAILED
/home/ec2-user/ant/ucp/build.xml:48: Problem: failed to create
task or type antlib:com.salesforce:retrieve
Cause: The name is undefined.
背景
我使用yum install ant
安装了ant,然后将Force.com迁移工具(ant-salesforce.jar)放到了/usr/share/ant/lib
中.运行ant -diagnostics
时,我可以看到该库,但是该库的所有任务都没有(应该看到部署,检索等).我已经上传了要点,其中包含ant -diagnostics
的完整输出.
I installed ant using yum install ant
and then I dropped the Force.com Migration Tool (ant-salesforce.jar) into /usr/share/ant/lib
. I'm able to see this library when I run ant -diagnostics
, but none of the tasks for that library (should be seeing deploy, retrieve, etc.). I've uploaded a gist with the full output from ant -diagnostics
.
-------------------------------------------
ANT_HOME/lib jar listing
-------------------------------------------
ant.home: /usr/share/ant
ant-bootstrap.jar (19837 bytes)
ant-salesforce.jar (3293054 bytes)
ant.jar (1942059 bytes)
ant-launcher.jar (18418 bytes)
经过大量的谷歌搜索和手动阅读后,我尝试了以下操作,但均无济于事(注意:以上诊断未进行以下任何更改).我知道我缺少明显的东西:(
After lots of googling and manual reading I tried the following to no avail (NB: the above diagnostics is without any of the below changes). I know I'm missing something obvious :(
- 设置$ ANT_HOME
export ANT_HOME=/usr/share/ant
- 设置权限
chmod +x /usr/share/ant/lib/salesforce-jar
- 与组
chown root:root /usr/share/ant/lib/salesforce-jar
- 通过-lib
ant -lib /usr/share/ant/lib/salesforce-jar retrieve ...
上课
- 使用-lib
ant -lib /usr/share/ant/lib retrieve ...
传递lib文件夹
- 将$ ANT_HOME添加到$ PATH
export PATH=$PATH:$ANT_HOME/bin
- Setting $ANT_HOME
export ANT_HOME=/usr/share/ant
- Fiddling with permissions
chmod +x /usr/share/ant/lib/salesforce-jar
- Fiddling with groups
chown root:root /usr/share/ant/lib/salesforce-jar
- Passing in class with -lib
ant -lib /usr/share/ant/lib/salesforce-jar retrieve ...
- Passing in lib folder with -lib
ant -lib /usr/share/ant/lib retrieve ...
- Adding $ANT_HOME to $PATH
export PATH=$PATH:$ANT_HOME/bin
推荐答案
如何将ant-salesforce.jar
保留在/home/ec2-user/ant/ucp
下,然后将taskdef
元素更改为如下所示:
How about keeping ant-salesforce.jar
under /home/ec2-user/ant/ucp
and then change the taskdef
element to look like this:
<taskdef resource="com/salesforce/antlib.xml" classpath="ant-salesforce.jar" />
再次运行您的构建,看看情况是否好转.将JAR与build.xml
放在同一文件夹中将帮助您消除权限问题.
Run your build again and see if things look better. Having the JAR in the same folder as build.xml
will help you eliminate issues with permissions.
这篇关于蚂蚁没有加载salesforce任务定义吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!