0

コンテキスト: コンパイル中に web.xml を構築しようとしています。このタスクを実行するには、ant スクリプトを使用します。Ant スクリプトは、プロパティ ファイルで定義されたプロパティを使用して、このタスクを完了します。

Ant スクリプトは、Maven-ant-plugin を使用して呼び出されます。

ただし、maven ビルドを行う場合。「Ant BuildException Could not load definitions from resource project.properties. It could not be found.」というメッセージで失敗します。

Ant スクリプトは次のようになります。



<project name="xyz" basedir="." default="make_webxml">
<target name="make_webxml">
<taskdef resource="project.properties"/>
<echo file="${webappdir}/web.xml">
<>
<>
</target>
</project>


${webappdir} は、プロパティ ファイルで定義されています。


メイブン・ポム:

<plugin>
  <artifactId>maven-antrun-plugin</artifactId>
  <executions>
    <execution>
      <phase>process-resources</phase>
      <configuration>
        <target>
        <ant dir="build/ant/" />
        </target>
        <tasks>  
              <ant antfile="build/ant/bld_webxml.xml" target="make_webxml"/>
        </tasks>
      </configuration>
      <goals>
        <goal>run</goal>
      </goals>
    </execution>
  </executions>
  </plugin> 

私は何か間違ったことをしていますか?

前もって感謝します

4

1 に答える 1