I have install maven in my machine. I have properly set the class-path and maven home folder. Every time I execute mvn clean install
, it gives me exception. I h
I faced the same problem but it resolved with some changes in setting.xml(.*\apache-maven-3.3.3\apache-maven-3.3.3\conf)
.
<proxies>
<proxy>
<id>proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>HOSTNAME</host>
<port>PORT</port>
</proxy>
</proxies>
Just check the hostname and port from the IE setting -> connections -> LAN Setting -> Proxy server
Hope this will resolve your problem also :)
I faced the same problem and was frustrated to see as to all options i tried and none of them work,
Turns out once you have configured everything correctly including settings.xml
just clear your local repository folder and try mvn commands. That greatly helped me
Hope this helps others
For all the Windows users, try moving your codebase to a shorter windows path for eg: C:/myProj
Deeply nested Maven jar files can create a longer file path in windows. Since windows OS, by default, limits the file path length to 260 characters, it throws exception when trying to read a file located at a path that becomes more than 260 characters.
You can change this default to increase this limit to more than 260 chracters. Search around the web and you will find many posts on how to do that.
You can face similar problem while using npm packages also.
Your debug output indicates that Clean is the first thing that it's trying to run, so I'm guessing it's failing to download any plugins from central.
First off, see if you can download the plugin jar directly in a web browser: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.jar
If that works then your web browser has connectivity to central but maven doesn't. That suggests to me that your web browser is using a proxy that maven isn't configured to use.
Maven proxy settings are described in depth here. To simplify that a little fill this out (replace the protocol/host/port with the values from your internet settings) and put it in the <settings>
tag of your maven settings.xml
file:
<proxies>
<proxy>
<id>proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.example.com</host>
<port>8080</port>
</proxy>
</proxies>
In my case my problem was that I was using an older version of NetBeans. The Maven repository removed an http reference, but the embedded Maven in Netbeans had that http reference hard-coded. I was really confused at first because my pom.xml referenced the proper https://repo.maven.apache.org/maven2.
Fixing it was pretty simple. I downloaded the latest zip archive of Maven from the following location and extracted it to my machine: https://maven.apache.org/download.cgi
Within Netbeans at Tools -> Options -> Java -> Maven on the "Execution" section I set "Maven Home" to the newly extracted zip file location.
Now I could build my project....
The error is due to maven official repository being not accessible. This repo (https://repo.maven.apache.org/maven2/) is not accessible so follow these steps:
<mirrors>
<mirror>
<id>UK</id>
<name>UK Central</name>
<url>http://uk.maven.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>