[2006-06-07-1] ではスコープを見てくれないと書いていたが,最新のものでは見てくれるようになったようだ.codehaus から maven 本家に移っているし.
で,だ.今回やりたいことは test:test が実行される前に依存jarファイルを指定ディレクトリにコピーしたいということだ.テストの中で依存jarファイルを覗いて,なんとかかんとかやりたいためだ.そのためには, executions/execution/phase を変更すれば良いようだ.package だとプロジェクトのjarファイルが作成されたあとに,compile だとコンパイルが終わってから,test だとテストが実行されてから,というようになるらしい.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>compile</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>