異なるバージョンのdepsでプロジェクトをビルドする必要があります(この例では、Postgres 8とPostgres 9)。また、開発者は自分のコンピュータ上に異なるバージョンのDBを持っています。_profiles_を使用してMaven3で変数依存バージョンを実装する方法は?
私はこのような何かをしようとしています:
<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を使用しても達成できません。
誰でもこれを行う方法を知っていますか?ありがとう。
これが正しく表示されます。おそらく、この依存関係は他の場所で上書き/反復されますか? – Raghuram