1

Ant スクリプトを使用して、pom.xml に記載されているすべての依存 jar をコピーしようとしています。pom.xmlでスコープ「システム」の依存関係を除くすべての依存関係をコピーできます

私のpom.xmlは次のようになります

<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>3.8.1</version>
</dependency>
<dependency>
    <groupId>javafx</groupId>
    <artifactId>jfxrt</artifactId>
    <version>${java.version}</version>
    <scope>system</scope>
    <systemPath>${java.home}/lib/jfxrt.jar</systemPath>
</dependency>

私のbuild.xmlは次のようになります

<target name="resolve"   description="retrieve dependencies with maven">
    <artifact:pom id="pomfile" file="pom.xml" />
    <echo message="Resolving...........${container}"></echo>
    <artifact:dependencies filesetId="dependency.fileset"> 
       <pom refid="pomfile" />               
    </artifact:dependencies>

    <!-- Copy all dependencies to the correct location. -->
    <copy todir="${ant.project.name}/lib">
        <fileset refid="dependency.fileset"  />              
            <mapper type="flatten" />
    </copy>
</target>

JUnit jar は指定された lib ディレクトリにコピーされますが、jfxrt.jar はコピーされません。

4

0 に答える 0