So I'm using Intellij and I am connecting to the internet via a proxy server. For some reason on my regular computer connected via wireless router it all works out but this one isn't working. I tried reloading the maven project, but to no avail.
For some reason pom.xml can't find my dependencies, and that's probably why.
This is the pom.xml: Top of pom.xml
Bottom of pom.xml
This is the problems tab in the console: Here
If you are using IntelliJ's embedded Maven, configure your proxy as per this [link]1.
You can copy the default settings.xml file from Maven install ${maven.home}/conf/settings.xml to ${user.home}/.m2/settings.xml.
Then, add a proxy section to your settings file as in explained in this guide.
Also, check with your company's infrastructure responsible that you are actually allowed to connect to Maven Central, for example at my current company we have a well-known brand firewall that, by default, blocks it.
Related
I am using Nexus and have configured maven-proxy and maven-hosted repositories, added them to a group repo and using that repo through settings.xml. Now when a new dependency is added in pom, maven-proxy goes to maven central and downloads it. However, I do not want this.
My goal is to stop replying on Maven central completely, but I know it won't work until my hosted repository contains everything that maven needs.
Issue is that Maven plugins like compiler, clean, jar etc. downloads tons of dependencies on its own. If I remove connection to maven proxy, how do I get all that list and then how do I make sure that I put whatever is needed in my hosted repository ?
Should I even try to put such artifacts in my hosted repo ? Is there any other better approach ?
You cannot really do that manually, the number of artifacts is way too large.
You can let Maven download all needed artifacts, then copy that from a remote to a hosted repository and work with that (until you need something new).
But it is still painful. I would not do that.
If your concern is security, I would use an open source security scanner instead of blocking internet access altogether.
Gradle Build fails with the above error. I am going thru firewall and proxy server settings. I do have local nexus repository hosted in the company network.
The module which is failing uses free marker templates and bundles them into a deployable jar. I suspect I am not including the java plugin in the repository.
Gradle plugin resolution uses a different configuration than dependency resolution.
You most likely need to customise it as well. The exact details will depend on your setup and constraints.
See the relevant documentation
It's a copy of this post with adding information (because it's not a copy of another questions like this).
I just instaill last version of Intellij idea on the new computer and can't make Maven work properly with empty project.
When it starts Maven try to download all it's plugins, but it stuck in infinite download. I try to add some dependcy and get infinity download of that dependcy
I have found a lot of peoples with such problems like this and a lot of others, but this solution doesn't work for me.
I already install last version of Maven instead of Maven inserted in idea:
Also I try to update information from main repository manual in idea Maven settings and got such error:
transfer for nexus-maven-repository-index.properties failed
There is post with problem like this, but it doesn't work for me either.
And if I try to use Maven from Terminal like this:
mvn -U idea:idea
(also I try to add proxy settings as arguments here) I've got such problems:
Failed to retrieve plugin descriptor for
org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin
org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its
dependencies could not be resolved: Failed to read artifact descriptor
for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
And a lot of problems like this with other plugins.
Try to use proxy in settings.xml and as commands in idea settings of Maven:
As #Tunaki already said add of proxy helped in most of cases, but not mine.
My settings.xml:
I found the problem. The connection was being blocked my the computer's firewall. Turning off Windows Firewall and Avast Internet Security makes it work without any proxy.
I am having issues building Nutch 2.2.1 behind my company firewall. My build gets stuck here:
[ivy:resolve] :: loading settings :: file = ~/nutchtest/nutch/ivy/ivysettings.xml
When I contacted the hosting admin, they said - "Ant is trying to download files from internet and it will have problems with our firewalls. You will either have to download the files yourself and then scp/sftp them to the machine. Unfortunately we don't have an http proxy."
From further digging, I could see Ant is trying to access this link http://ant.apache.org/ivy/. Could anyone please advise what I should do to make Ant compile Nutch without accessing the internet? I can download required files from http://ant.apache.org/ivy/ and scp/sftp to the server but I am not sure what files to download and where to put them?
Run the build on a machine connected to the internet. Ivy will cache your build's dependencies here (by default):
$HOME/.ivy2/cache
A populated cache will enable you to repeat the build inside your firewall.
I would also suggest enhancing the build to run the ivy report task. This will produce webpage listing the dependency tree. If you want to build a local repository this information is very useful.
Finally consider running a repository manager inside your firewall. Tools like Nexus and Artifactory make repository hosting a lot simpler to manage. Consider obtaining a firewall exception for this server. Repository managers are used to cache useful internet repositories like Maven Central.
I am using M2Eclipse (0.10.0, Maven 3)in projects. I can add Maven dependency using m2eclipse. But dependency jars couldn't be downloaded. Instead, it created a file in each local repo folder named [JAR_Name].jar.lastupdate. The content of this file is some thing like :
http://[REPO_URL]/central/=1276221188566
Even using Maven 3 command line. Jars couldn't be downloaded. Any idea about how could this happen?
First off, the presence of "lastupdated" file is irrelevant. We need to know the debug output (mvn -X dependency:tree). Then you mentioned you were using repository manager and mirroring every request to it - so setup settings.xml according to this guide . If you just specified the mirror element with repository manager location and what repositories (URLs) you want to proxy ,(without that profile enabled which is practically changing policy for getting snapshots), you would have something like "central repository disabled" messages in your debug log. After you fix it, it should work.
EDIT: You can always use the URL of group repository from maven settings.xml http://hostname/nexus/content/groups/public + path to the artifact like "org/apache/maven/someartifact/maven-metadata.xml" and see if nexus can proxy the request and serve what you want. If this works, then the reason must be either in maven settings or pom definition.
I have the same problem. Don't know a 'real' solution, but whenever something isn't working I do a scan for .lastUpdated files in my local repo and delete them. Then things usually work again. (I think that might be due to a badly configured nexus, but unfortunately I don't have access to the nexus config)