简体   繁体   中英

Maven failed to execute goal without internet connection

I'm trying to get a Maven build working for a Java project, with the rather interesting caveat that the machine I'm building on does not have, and cannot have, access to the Maven repository.

The error I'm getting with any of the Lifecycle processes I try and run is

Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project xxxxxx: Execution default-clean of goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean failed: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Cannot access central ( https://repo.maven.apache.org/maven2 ) in offline mode and the artifact org.codehaus.plexus:plexus-utils:jar:1.1 has not been downloaded from it before. -> [Help 1]

Because of the disconnected nature of the machine I'm working on, I've had to have the Maven build tool manually downloaded for me, and from the error messages I've been receiving, I've also had the relevant plugins manually downloaded ( maven-clean-plugin-2.5.jar for example), but I'm having trouble figuring out where to put the plugins manually so Maven can pick them up and work with them.

This looks like locked directory. Are you sure the process you are trying to build is not running, and no external program is using the project directory.

Try removing the target directory manually.

Edit: Ok, so it's actually a problem with remote maven repository.

Have you tried configuring a custom maven repo

<project>
  ...
  <repositories>
    <repository>
      <id>my-internal-site</id>
      <url>http://myserver/repo</url>
    </repository>
  </repositories>
  ...
</project>

More info here

Yes. It looks like maven is not able to delete the working directory. Check if any process locking your directory. Else delete it manually.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM