0

ANT コマンドで FTP タグを使用して、FTP ロケーションからファイルを受信したいと考えています。これを有効にするために、ANT の lib フォルダーにコピーjakarta-oro-2.0.8.jarしました。apache-commons-net.jarコマンドの実行中に次のエラーが発生します: java.lang.Error: Unresolved compilation問題:

    The import org.apache.oro cannot be resolved
    The import org.apache.oro cannot be resolved
    The import org.apache.oro cannot be resolved
    The import org.apache.oro cannot be resolved
    The import org.apache.oro cannot be resolved
    The import org.apache.oro cannot be resolved
    Pattern cannot be resolved to a type
    MatchResult cannot be resolved to a type
    PatternMatcher cannot be resolved to a type
    _matcher_ cannot be resolved
    Perl5Matcher cannot be resolved to a type
    pattern cannot be resolved
    Perl5Compiler cannot be resolved to a type
    MalformedPatternException cannot be resolved to a type
    result cannot be resolved or is not a field
    _matcher_ cannot be resolved
    pattern cannot be resolved or is not a field
    result cannot be resolved or is not a field
    _matcher_ cannot be resolved
    result cannot be resolved or is not a field
    result cannot be resolved or is not a field
    result cannot be resolved or is not a field
    result cannot be resolved or is not a field
    result cannot be resolved or is not a field
    result cannot be resolved or is not a field
    result cannot be resolved or is not a field

    at org.apache.commons.net.ftp.parser.RegexFTPFileEntryParserImpl.<init>(RegexFTPFileEntryParserImpl.java:19)
    at org.apache.commons.net.ftp.parser.ConfigurableFTPFileEntryParserImpl.<init>(ConfigurableFTPFileEntryParserImpl.java:57)
    at org.apache.commons.net.ftp.parser.UnixFTPEntryParser.<init>(UnixFTPEntryParser.java:136)
    at org.apache.commons.net.ftp.parser.UnixFTPEntryParser.<init>(UnixFTPEntryParser.java:119)
    at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createUnixFTPEntryParser(DefaultFTPFileEntryParserFactory.java:169)
    at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createFileEntryParser(DefaultFTPFileEntryParserFactory.java:94)
    at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2359)
    at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2142)
    at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2188)
    at org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.forceRemoteSensitivityCheck(FTP.java:695)
    at org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.scan(FTP.java:372)
    at org.apache.tools.ant.taskdefs.optional.net.FTP.transferFiles(FTP.java:1738)
    at org.apache.tools.ant.taskdefs.optional.net.FTP.transferFiles(FTP.java:1850)
    at org.apache.tools.ant.taskdefs.optional.net.FTP.execute(FTP.java:2539)

Ant が ORO 依存関係のインポートに失敗するのはなぜですか?

4

1 に答える 1

0

ANT 1.6.5 は ANT の非常に古いバージョンです。次の例は、ANT 1.9.0 でテストされています。

<project name="demo" default="build">

   <target name="bootstrap">
      <mkdir dir="${user.home}/.ant/lib"/>
      <get dest="${user.home}/.ant/lib/commons-net.jar" src="http://search.maven.org/remotecontent?filepath=commons-net/commons-net/3.3/commons-net-3.3.jar"/>
      <get dest="${user.home}/.ant/lib/oro.jar" src="http://search.maven.org/remotecontent?filepath=oro/oro/2.0.8/oro-2.0.8.jar"/>
   </target>

   <target name="build">
      <ftp server="ftp.apache.org" userid="anonymous" password="me@myorg.com">
         <fileset dir="htdocs/manual"/>
      </ftp>
   </target>

</project>

ブートストラップ ターゲットは、欠落している ftp タスクの依存関係を、次回の実行時に ANT が使用する場所にインストールします。

于 2013-09-13T22:40:08.023 に答える