異なるバージョンの deps でプロジェクトをビルドする必要があります (この例では、Postgres 8 と Postgres 9)。また、私たちの開発者は、コンピューターにさまざまなバージョンの DB を持っています。
私はこのようなことをしようとしています:
<profile>
<id>postgres9</id>
<properties>
<postgres.driver.version>
9.0-801
</postgres.driver.version>
</properties>
</profile>
<profile>
<id>postgres8</id>
<properties>
<postgres.driver.version>
8.3-603
</postgres.driver.version>
</properties>
</profile>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgres.driver.version}</version>
</dependency>
<properties>
<postgres.driver.version>8.3-603</postgres.driver.version>
</properties>
mvn clean test -Ppostgres9
しかし、うまくいきませんでした。プロファイル変数は pom 変数をまったくオーバーライドしていません。また、~/.m2/settings.xml でも実現できません。
誰もこれを行う方法を知っていますか? ありがとう。