Search code examples
javamavenglassfishjersey

Could not resolve archetype org.glassfish.jersey.archetypes:jersey quickstart-webapp


I am trying to create a Maven based Jersey quick starter web App. I am selecting the glassfish archetype. But it is giving me the error given below. It is successfully creating com.sun.jersey archetype project. But with glassfish one its having issues. There are no proxy setup in my laptop which could interfere in downloading process. I need to sort this out asap.

Could not resolve archetype org.glassfish.jersey.archetypes:jersey quickstart-webapp:2.19 from any of the configured repositories.
Could not resolve artifact org.glassfish.jersey.archetypes:jersey-quickstart-webapp:jar:2.19
Failure to transfer org.glassfish.jersey.archetypes:jersey-quickstart-webapp:jar:2.19 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. 
Original error: Could not transfer artifact org.glassfish.jersey.archetypes:jersey-quickstart-webapp:jar:2.19 from/to central (https://repo.maven.apache.org/maven2): connect timed out
Failure to transfer org.glassfish.jersey.archetypes:jersey-quickstart-webapp:jar:2.19 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.glassfish.jersey.archetypes:jersey-quickstart-webapp:jar:2.19 from/to central (https://repo.maven.apache.org/maven2): connect timed out

Solution

  • It seems there is a typo error in the archetype's artifact: there is a missing hyphen. It's "jersey-quickstart-webapp" and not "jersey quickstart-webapp".

    But there is also a timeout from Maven Central, so may be it was only that MC was not available at the time of transfert.

    Whatever, before any new trial, delete the folders:
    - ~/.m2/repository/org/glassfish/jersey/archetypes/jersey quickstart-webapp
    - ~/.m2/repository/org/glassfish/jersey/archetypes/jersey-quickstart-webapp