Search code examples
maven

Maven project creation


I have tried searching answer for my error message

ArtifactTransferException: Failure to transfer xml-apis:xml-apis:jar:1.4.01 from http://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 xml-apis:xml-apis:jar:1.4.01 from/to central (http://repo.maven.apache.org/maven2): No response received after 60000

Tried with some suggestion given too but my problem is not resolved.


Solution

  • Try doing a maven update, if that doesn't resolve then add the jar file manually into .m2 maven repository with the below command executed from the command prompt if your OS is Windows after downloading xml-apis.jar file.

    mvn install:install-file -Dfile={Path}/filename.jar -DgroupId=xml-apis -DartifactId=xml-apis -Dversion=1.4.01 -Dpackaging=jar
    

    and add the below dependency to the pom.xml

    <dependency>
        <groupId>xml-apis</groupId>
        <artifactId>xml-apis</artifactId>
        <version>1.4.01</version>
    </dependency>
    

    Try cleaning and building the project will build successfully.