Maven では、アーティファクトがまだリポジトリにインストールされていない場合にのみビルドを実行したいと考えています。私の考えは、デフォルトで非アクティブになっているプロファイルを使用することですが、アーティファクトが見つからない場合はアクティブになります。Maven プロパティはプロファイルのアクティブ化に使用できないように見えるため、これまでのところ成功していませんか?
settings.xml:
...
<localRepository>/local/m2repo</localRepository>
...
1)これは機能します:
pom.xml:
...
<profile>
<id>my-profile</id>
<activation>
<activeByDefault>false</activeByDefault>
<file>
<missing>/local/m2repo/something</missing>
</file>
</activation>
...
</profile>
2) これは機能しません:
pom.xml:
...
<profile>
<id>my-profile</id>
<activation>
<activeByDefault>false</activeByDefault>
<file>
<missing>${settings.localRepository}/something</missing>
</file>
</activation>
...
</profile>
3)これも機能しません:
settings.xml:
...
<properties>
<local.repository>${settings.localRepository}</local.repository>
</properties>
...
pom.xml:
<profile>
<id>my-profile</id>
<activation>
<activeByDefault>false</activeByDefault>
<file>
<missing>${local.repository}/something</missing>
</file>
</activation>
</profile>
アーティファクトの存在を確認し、必要な場合にのみビルドを実行するための回避策または代替手段はありますか? アイデアをありがとう!