1

every time I build our project, it always shows some warnings like this

[WARNING] Could not transfer metadata {one of our own snapshot lib}/maven-metadata.xml from/to repository.jboss.org (http://repository.jboss.org/nexus/content/groups/public/): Connect to repository.jboss.org:443 [repository.jboss.org/209.132.182.97] failed: Connection timed out (Connection timed out)

[INFO] Downloading: https://maven.java.net/content/repositories/xxx/1.0.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: https://repository.apache.org/content/repositories/xxx/1.0.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://snapshots.repository.codehaus.org/xxx/1.0.0-SNAPSHOT/maven-metadata.xml

we usually can build successfully at last, but some time it will block the build progress for one hour or more.

The interesting thing is that this lib is our own lib in our own nexus server, but maven always tries to download its metadata from other third party repository.

What should I do?

Steven Zhu
  • 41
  • 2
  • *maven always tries to download its metadata from other third party repository* well, i belive maven will always try to update from central which take a very long time. You can try to [restrict maven to specific server](https://stackoverflow.com/a/12808666/4648586)... – Bagus Tesa Oct 28 '19 at 03:57

2 Answers2

0

You probably specified that jboss repository, which for some reason you cannot connect to, in your settings.xml. It could also come from a POM file if your settings.xml does not have a mirror entry.

Furthermore, the jboss repository probably comes before the internal repository, so that Maven tries to look there first.

Best thing is usually to manage all external repositories through the company Nexus server and just point to that in the setting.xml.

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142
0

The only reason for Maven to download are SNAPSHOTs (that's probably a clear one) or version ranges. If a direct or transitive dependency uses a version range (which isn't always visible), Maven will download the meta file. Depending on your project you should try to minimize this and lock these versions in your own project. It'll make the build faster and more reliable. You should be able to finetune Nexus with regards to timeout, etc.

Robert Scholte
  • 11,889
  • 2
  • 35
  • 44