Kinjal Dixit Kinjal Dixit - 1 year ago 65
Java Question

Unresolved dependencies error when following Jersey 2.0 user guide

Update: This does not/should not occur anymore, see accepted answer. If you are facing this problem with some other jar, it is typically a transient thing. You can try some of the workaround suggested in other answers.

I am following the instructions from Jersey 2.0 user guide. When I reach 1.3 (running the project, I get the following failure:

[ERROR] Failed to execute goal on project xxx-service: Could not resolve dependencies for project xxx.restapi:xxx-service:jar:1.0-SNAPSHOT: Failure to find javax.annotation:javax.annotation-api:jar:1.2 in was cached in the local repository, resolution will not be reattempted until the update interval of has elapsed or updates are forced -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]

The problem seems to be that there is no

If we go up to
we see that the folders and jar files inside those folders are renamed with a suffix of

The pom itself does not have any direct reference to this annotations jar. So I guess the question is: How do I adjust that dependency? What do I put in the POM file that will get that dependency resolved correctly?

Answer Source

In the meanwhile, this problem no longer occurs. javax.annotation:javax.annotation-api:jar:1.2 is now available on Maven central.