[Fix] Cannot resolve No versions available for org.osgi.service:org.osgi.service.prefs:jar:[1.1.0,1.2.0) within specified range


Today I ran into the below error while trying to build my Java Spring Maven project in Eclipse,

Cannot resolve No versions available for org.osgi.service:org.osgi.service.prefs:jar:[1.1.0,1.2.0) within specified range.
[ERROR] Failed to execute goal on project c2c: 
Could not resolve dependencies for project org.code2care.c2c:redundantcheck:jar:1.0-SNAPSHOT: 
Failed to collect dependencies at org.eclipse.jdt:org.eclipse.jdt.core:jar:3.20.0 -> 
org.eclipse.platform:org.eclipse.core.resources:jar:3.12.0 -> 
org.eclipse.platform:org.eclipse.core.expressions:jar:3.5.100 -> 
org.eclipse.platform:org.eclipse.core.runtime:jar:3.12.0 -> 
org.eclipse.platform:org.eclipse.equinox.preferences:jar:3.10.0 -> 
org.osgi.service:org.osgi.service.prefs:jar:[1.1.0,1.2.0): No versions available for 
org.osgi.service:org.osgi.service.prefs:jar:[1.1.0,1.2.0) within specified range -> [Help 1]
Solution:

Make use of org.eclipse.platform:org.eclipse.equinox.preferences:jar 3.10.1 version instead of 3.10.0

<dependency>
    <groupId>org.eclipse.jdt</groupId>
    <artifactId>org.eclipse.jdt.core</artifactId>
    <version>3.10.1</version>
</dependency>

Read More: https://github.com/eclipse-equinox/equinox.bundles/issues/54

Advertisements
Try Out Code2care Dev Tools:

Advertisements

Advertisements
Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.