I can’t “explain" the mvn behavior :-) But you can observe the result yourself:
- get the latest sample repo code on the develop branch
- ./mvnw clean package # expect to fail because the pom is trying to use
runtime version 1.2.0
- ./mvnw clean package -Dedgent.runtime.version=1.2.0-SNAPSHOT
sample utils builds fine (using runtime 1.2.0-SNAPSHOT versions)
samples apps then fails due to dependency confusion caused by property
override behavior (trying to use 1.2.0):
...
[ERROR] Path to dependency:
[ERROR] 1) org.apache.edgent:edgent-samples-apps:jar:1.2.0-SNAPSHOT
[ERROR] 2) org.apache.edgent:edgent-samples-utils:jar:1.2.0-SNAPSHOT
[ERROR] 3) org.apache.edgent:edgent-utils-metrics:jar:1.2.0 <===
say what?
All works fine if instead the edgent.runtime.version property in the top-level
pom is edited to specify 1.2.0-SNAPSHOT
> On Nov 22, 2017, at 12:21 PM, Christofer Dutz <[email protected]>
> wrote:
>
> Hi Dale,
>
> Öhm … could you explain why? Usually –D property values have the highest
> priority.
>
> Chris
>
> Am 22.11.17, 18:04 schrieb "Dale LaBossiere" <[email protected]>:
>
>
>> On Nov 21, 2017, at 5:10 PM, Dale LaBossiere <[email protected]> wrote:
>> Prior to that time, when building the samples, one can do
>> ./mvnw clean package -Dedgent.runtime.version=1.2.0-SNAPSHOT # assuming
>> you’ve done an “install” of that runtime version
>
> arrg… due to maven-isms, overriding via -D doesn’t work. You must edit
> the value in the sample’s top-level pom.
> I’ve updated the samples doc accordingly.
>
> — Dale
>
>
>