Maven in our development process. Part 2 – Maven infrastructure.

In Part 1of this series I talked about our requirements for the Maven process and the issues we needed to resolve.

In this part I will focus on the infrastructure that Maven needs to have in place and how we set it up to suite our needs..

Repositories

With Maven you use repositories to store your libraries. In fact you store artifacts in the repositories. We have a few repositories for different types of artifacts:

All those repositories are accessible via WebDAV. Here is how access restrictions to those repositories are configured (the arrow pointing back at the repository means write access):

Proxies

We do not use our repositories directly though. Instead – we have two Archiva proxies.

External proxy is hosted outside the office. The internal proxy is in Sydney office. When connecting to m2proxy.atlassian.com internally, internal DNS server will resolve it to the local proxy. Outside the office, it will resolve to the external proxy. This is quite convenient since it allows people to seamlessly roam between offices or work from home without affecting their Maven settings.

Since we wanted only to maintain one proxy for developers, customers and contributors, we have partitioned the proxy into two parts.

The internal proxy, in turn, will resolve against the private section of the external proxy.

The only time when repositories are accessed directly is when writing to them. Write requests are authenticated against our Crowd instance and a distinction is made between atlassian-staff and atlassian-devnet roles for authorization.

Maven proxies also cache things that they download. This means if a version of a product was built once against the proxy, it will always be possible to build that version again even if any one of the repositories is down. This is especially important when it comes to the external repositories. Our proxies are also connected to a few different external repositories in case there is an outage on some of them.

Setting up your local Maven

A Maven environment is configured via its settings.xml file. For our Maven users we have three types of settings.xml.

The first two files have to be configured with your username and password if you are going to deploy any artifacts to our repositories. Customers use the repositories for building our products only and normally do not have usernames in our Crowd database.

Summary

The infrastructure I describe above achieves the following:

If your environment is small – you might not need such a complex repository set up. Stay tuned though as the next part is where the actual Maven setup is covered.

.. to be continued

Part 3 will describe you how our projects (all of those libraries I talked about) are configured to make their builds deterministic and repeatable.

Unfortunately, even after several years, our Maven infrastructure is not perfect. Part 4 will cover issues we hit every now and again and explain how we deal with them.

Exit mobile version