mvn package error: unknown host repo.maven.apache.org

I'm using intelliJ IDEA 14.1.4 and when

mvn package 

is entered I get this message

[INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building test1 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ Downloading: [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 21.344s [INFO] Finished at: Sat Dec 12 15:00:57 IST 2015 [INFO] Final Memory: 9M/88M [INFO] ------------------------------------------------------------------------ [ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.3: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.3 from/to central (): repo.maven.apache.org: Name or service not known: Unknown host repo.maven.apache.org: Name or service not known -> [Help 1] [ERROR] [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] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] 

I've set the proxy in ~/.m2/setting.xml but, still get this error. Helps please..

1

1 Answer

Try the below command from the path where your pom.xml is present,

$ git config --global url."https://".insteadOf git:/ 

it worked for me.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like