Skip to content

Commit

Permalink
Limit org.eclipse.equinox.p2.core dependency
Browse files Browse the repository at this point in the history
Christoph Läubrich committed Dec 7, 2022
1 parent 5bd167b commit 92b350f
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -47,4 +47,9 @@ public void unregisterService(String serviceName, Object service) {
serviceFactory.getService(IProvisioningAgent.class).unregisterService(serviceName, service);
}

@SuppressWarnings("unchecked")
public <T> T getService(Class<T> key) {
return (T) getService(key.getName());
}

}
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -288,6 +288,11 @@
<artifactId>bcpg-jdk18on</artifactId>
<version>(,1.71]</version>
</dependency>
<dependency>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.p2.core</artifactId>
<version>(,2.6.200]</version>

This comment has been minimized.

Copy link
@kwin

kwin Dec 7, 2022

Contributor

Please don’t use ranges to pin versions. Just a single version which is known to work. Compare with https://maven.apache.org/pom.html#dependency-version-requirement-specification

This comment has been minimized.

Copy link
@laeubi

laeubi Dec 7, 2022

Member

I tried this in the past and it seems to not prevent pulling in never versions (see lines above) but probably will try next time again :-)
dependecy-tree at least shows that this effectively overrules the range from transitive dependency definition.

This comment has been minimized.

Copy link
@laeubi

laeubi Dec 7, 2022

Member

Also your referenced documentation indicates this:

Soft requirement for 1.0. Use 1.0 if no other version appears earlier in the dependency tree

and later on

Maven picks the highest version of each project that satisfies all the hard requirements of the dependencies on that project.

And as the transitive dep uses a hard-requirement already we need a hard requirement here as well.

</dependency>
</dependencies>
</dependencyManagement>

0 comments on commit 92b350f

Please sign in to comment.