getting org.apache.maven.plugins:maven-jar-plugin:2.3.2 or one of its dependencies could not be resolved error

I have made the maven clean install on one machine (machine 1) build was successful, I have copied the maven m2 repo on another machine (machine 2) and tried to run maven clean with offline option

mvn clean install -o

getting the below error.

[ERROR] Plugin org.apache.maven.plugins:maven-jar-plugin:2.3.2 or one of its dependencies could not be resolved: Cannot access autoincrement-versions-maven-plugin ( in offline mode and the artifact org.apache.maven.plugins:maven-jar-plugin:jar:2.3.2 has not been downloaded from it before.

My requirement is to we need to ship maven repo to client and he will be running with

mvn clean install -o.

2 answers

  • answered 2018-07-12 02:19 Xie Felix

    I think you may change the maven settings of eclipse in machine 2.

    Eclipse -> Window -> preference -> search maven -> User settings,modify the user maven settings file location(you may copy from machine 1), and see the Local Repository.

    maven user settings in eclipse

  • answered 2018-07-12 02:46 Timothy T.

    The error is basically telling you two things:

    1. It cannot find the dependency: autoincrement-versions-maven-plugin
    2. It is trying to download this dependency from the global maven repository, but as you are running it in offline mode, it is not allowed to do so.

    Check on the second machine to see if the dependency exists, and if the dependency files are there. If it is only complaining about this dependency and the rest are okay, then you are most probably be referencing the repository correctly, and the error is due to missing files.

    It is difficult to debug this issue just by the error message as this might be a knock-on from another configuration error.