1

「antt」という名前のプロジェクトを作成して、Eclipse の移行ツールで ant をテストしました。私はEclipseでJavaプロジェクトを作成し、そこから「テスト」を実行しようとしました。

build.xml の「テスト」:

 <!-- Test out deploy and retrieve verbs for package 'mypkg' -->
    <target name="test">
      <!-- Upload the contents of the "mypkg" package -->
      <sf:deploy username="${sf.username}" password="${sf.password}" sessionId="${sf.sessionId}" serverurl="${sf.serverurl}" maxPoll="${sf.maxPoll}" deployRoot="mypkg" rollbackOnError="true"/>
      <mkdir dir="retrieveOutput"/>
      <!-- Retrieve the contents into another directory -->
      <sf:retrieve username="${sf.username}" password="${sf.password}" sessionId="${sf.sessionId}" serverurl="${sf.serverurl}" maxPoll="${sf.maxPoll}" retrieveTarget="unpackaged" packageNames="MyPkg"/>
    </target>

エラー:

Buildfile: C:\SF\workspacenew\antt\build.xml test:

BUILD FAILED C:\SF\workspacenew\antt\build.xml:19: Problem: failed to create task or type antlib:com.salesforce:deploy 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. No types or tasks have been defined in this namespace yet

This appears to be an antlib declaration.  Action: Check that the implementing library exists in one of:
        -C:\eclipse\plugins\org.apache.ant_1.8.4.v201303080030\lib
        -C:\Users\User\.ant\lib
        -a directory added on the command line with the -lib argument


Total time: 560 milliseconds
4

1 に答える 1

0

こちらの私の回答を参照してください。

  1. プロジェクトのルートに lib ディレクトリを作成し、その中に maven-ant-tasks.jar ファイルを配置します。
  2. import ステートメントをbuild.xml

    <path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.3.jar" />
    <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" />
    

お役に立てれば。

于 2016-01-10T07:16:57.407 に答える