12

Mmaven antrun プラグインを使用せずに、Maven を使用してディレクトリ全体を別のディレクトリにコピーする方法を知りたいです。

4

2 に答える 2

18

Maven リソース プラグインを使用できます。

彼らのドキュメントから取られた例として:

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.6</version>
        <executions>
          <execution>
            <id>copy-resources</id>
            <!-- here the phase you need -->
            <phase>validate</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${basedir}/target/extra-resources</outputDirectory>
              <resources>          
                <resource>
                  <directory>src/non-packaged-resources</directory>
                  <filtering>true</filtering>
                </resource>
              </resources>              
            </configuration>            
          </execution>
        </executions>
      </plugin>
    </plugins>
    ...
  </build>
  ...
</project>

私が間違っていなければ、これは の内容directoryをにコピーします。outputDirectory

于 2013-07-25T07:55:20.287 に答える