1

別の ant ビルド ファイルを呼び出して、その結果をディレクトリにコピーしようとすると、問題が発生します。

<!-- Copying PatientStation -->

<ant dir="../SubProject" antfile="build.xml" />

<copy todir="D:/Export">
    <fileset dir="../SubProject/${fullVersionName}/jar" />
</copy>

アリの呼び出しの後、私は現在のディレクトリではなくリモート ディレクトリに配置されていません。

BUILD FAILED
D:\myWorkspace\Build\build1.xml:64: D:\myWorkspace\SubProject\D:\Export does not exist.
4

2 に答える 2

1

目の前にPCがないので、何が機能するかはっきりとは言えませんが、通常、Antでは、ディレクトリがスラッシュで始まらない場合、現在のサブディレクトリであると見なされます。${basedir}

次のいずれかを試してください。

<!-- You're in the "D" drive, so don't specify the drive letter -->
<!-- This specifies the current drive you're on -->
<copy todir="/Export"/>

または

<!-- If that doesn't work, try this -->
<!-- Windows uses backslash as separators -->
<copy todir="D:\\Export"/>

または

<!-- Add a slash in front of the drive letter -->
<copy todir="/D:/Export"/>

これらの1つが機能します。

于 2012-12-21T16:27:27.093 に答える
0

宛先フォルダーの場所を変数に設定することでそれを行うことができます。

これを試してください:

    <property name="tgtpath" location="D:/Export" />
    <copy todir="${tgtpath}">
        <fileset dir="../SubProject/${fullVersionName}/jar" />
    </copy>
于 2016-07-09T09:24:45.950 に答える