0

I have installed Intellij IDEA and MAVEN on my work computer which use proxy server to access internet. I tried different configuration of proxy in settings of the IJ but nothing helped. I still got error while trying to build project:

Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom

However when I do check connection IJ tells me that connection is successful. I can also open https://repo.maven.apache.org/maven2 in browser.

The question is what should I download and where to paste it in my project in order to make it see junit and run my tests. (As i understand it should be *.jar file(s) in particular directory)? Should I also edit some *.xml or other files in project - to type in paths to the jar files?

Thank You.

Sergii
  • 1,017
  • 1
  • 10
  • 19
  • 1
    Do you have configured the proxy in your settings.xml file? I doubt you have otherwise it would work...also check your build first on plain command line... – khmarbaise Jul 21 '22 at 13:39
  • 1
    Does this answer your question? [How do I use Maven through a proxy?](https://stackoverflow.com/questions/1251192/how-do-i-use-maven-through-a-proxy) – Étienne Miret Jul 21 '22 at 13:43
  • "Do you have configured the proxy in your settings.xml file?" - no I don't. How can I add it? "check your build first on plain command line" - I tried 'mvn -o install' in cmd and got same error. – Sergii Jul 21 '22 at 13:43
  • You need to make sure the Maven from the command line works. E.g. can you successfully build the project using `mvn clean compile` from the command line? If not, - looks like indeed you must configure the proxy for Maven first. – Andrey Jul 21 '22 at 14:18

1 Answers1

0

The problem was in MVN settings - you need to get into C:\Program Files\apache-maven-3.8.6\conf (or where your maven is) and enter proxy settings there (don't forget to uncomment first). E.g.

<proxy>      
  <active>true</active>
  <protocol>http</protocol>      
  <host>your_proxy</host>
  <port>8080</port> <nonProxyHosts></nonProxyHosts>   
</proxy>    

You can check your proxy settings in Network & Internet -> Proxy (Windows 10, Settings)

Thank you
khmarbaise, Andrey.

Sergii
  • 1,017
  • 1
  • 10
  • 19