coherence-community / oracle-bedrock

Oracle Bedrock
Other
54 stars 31 forks source link

Maven.artifact(...) should override previously defined artifacts #426

Closed brianoliver closed 7 years ago

brianoliver commented 7 years ago

As a developer, I expect that when using the Maven.artifact(...) option to define Maven artifacts, it will override previously defined artifacts that only differ by version, the latest definition overriding earlier definitions. Currently using Maven.artifact(...) will simply add and not override artifacts of the same Group, Artifact, Classifier and Extension.

For example, the following options would define a classpath with two jars:

    Maven.artifact("com.oracle.coherence", "coherence", "3.7.1"),
    Maven.artifact("com.oracle.coherence", "coherence", "12.2.1-0-0"),

where as it should only define a classpath consisting of the last artifact, as it only differs by the version number of a previously defined artifact.

brianoliver commented 7 years ago

When overriding a previously defined artifact, the location of the overriding artifact in the effective classpath will be that of the initially defined and thus overridden artifact. That is, the order of artifacts in a classpath is not changed when an artifact it overridden. The new artifact simply replaces the previously defined artifact.