ANT error: failed to create task or type antlib:com.salesforce:deploy -
i've started play force.com migration tool. want utilize ant build file. i've created one:
<project name="subversion org" default="deploy" basedir="." xmlns:sf="antlib:com.salesforce"> <target name="deploy"> <echo message="deploying metadata" /> <echo message="ant_home=${ant.home}"/> <echo message="basedir=${basedir}"/> <echo message="ant_core_lib=${ant.core.lib}"/> <echo message="java_version=${ant.java.version}"/> <echo message="ant_library_dir=${ant.library.dir}"/> <echo message="classpath=${java.class.path}"/> <sf:deploy username="${properties.username}" password="${properties.password}" serverurl="${properties.url}" deployroot="${properties.root}" singlepackage="${properties.singlepackage}" runalltests="${properties.alltest}" /> </target> </project>
i've copied ant-salesforce.jar in ant.lib folder. when execute file throught ant this:
buildfile: build.xml deploy: [echo] deploying metadata [echo] ant_home=/usr/share/ant [echo] basedir=/usr/share/tomcat6/.jenkins/jobs/salesforce deploy test/workspace/deploy script [echo] ant_core_lib=/usr/share/java/ant-1.7.1.jar [echo] java_version=1.6 [echo] ant_library_dir=/usr/share/ant/lib [echo] classpath=/usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:/usr/lib/jvm/java/lib/tools.jar:/usr/share/ant/lib/ant.jar:/usr/share/ant/lib/ant-launcher.jar:/usr/share/ant/lib/ant-salesforce.jar:/usr/share/ant/lib/ant-bootstrap.jar build failed /usr/share/tomcat6/.jenkins/jobs/salesforce deploy test/workspace/deploy script/build.xml:16: problem: failed create task or type antlib:com.salesforce:deploy cause: name undefined. action: check spelling. action: check custom tasks/types have been declared. action: check <presetdef>/<macrodef> declarations have taken place. no types or tasks have been defined in namespace yet appears antlib declaration. action: check implementing library exists in 1 of: -/usr/share/ant/lib -/root/.ant/lib -a directory added on command line -lib argument total time: 0 seconds
it seems ant-salesforce.jar file isn't found, appears listed in output. ideas?
more info:
permissions check
ls -al /usr/share/ant/lib total 3412 drwxr-xr-x. 2 root root 4096 feb 12 15:36 . drwxr-xr-x. 4 root root 4096 feb 12 09:49 .. lrwxrwxrwx. 1 root root 28 feb 12 09:49 ant-bootstrap.jar -> ../../java/ant-bootstrap.jar lrwxrwxrwx. 1 root root 18 feb 12 09:49 ant.jar -> ../../java/ant.jar lrwxrwxrwx. 1 root root 27 feb 12 09:49 ant-launcher.jar -> ../../java/ant-launcher.jar -rwxrwxrwx. 1 root root 3483648 feb 12 12:58 ant-salesforce.jar
jar contents check:
... com/salesforce/ant/bulkretrievetask.class com/salesforce/ant/compileandtest$codenameelement.class com/salesforce/ant/compileandtest$runtestselement.class com/salesforce/ant/compileandtest.class com/salesforce/ant/configuration.class com/salesforce/ant/connectionfactory.class com/salesforce/ant/deploytask$codenameelement.class com/salesforce/ant/deploytask.class com/salesforce/ant/describemetadatatask.class com/salesforce/ant/listmetadatatask.class com/salesforce/ant/retrievetask$packagemanifestparser.class com/salesforce/ant/retrievetask.class com/salesforce/ant/sfdcanttask.class com/salesforce/ant/sfdcmdapianttask.class com/salesforce/ant/sfdcmdapianttaskrunner.class com/salesforce/ant/ziputil.class com/salesforce/antlib.xml ...
antlib file contents (as expected):
<antlib> <typedef name="compileandtest" classname="com.salesforce.ant.compileandtest"/> <typedef name="deploy" classname="com.salesforce.ant.deploytask"/> <typedef name="retrieve" classname="com.salesforce.ant.retrievetask"/> <typedef name="bulkretrieve" classname="com.salesforce.ant.bulkretrievetask"/> <typedef name="listmetadata" classname="com.salesforce.ant.listmetadatatask"/> <typedef name="describemetadata" classname="com.salesforce.ant.describemetadatatask"/> </antlib>
thanks in advance.
your syntax sf:deploy good. matches mine.
check project definition. setting namespace of xmlns:sf right value?
should be:
<project name="salesforce" default="deploy" basedir="." xmlns:sf="antlib:com.salesforce">
you check permissions of ant-salesforce.jar.
and check jar not corrupted
jar -tf ant-salesforce.jar
ant salesforce force.com
No comments:
Post a Comment