17.08.2016 Views

Apache Maven 3 Cookbook

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Agile Team Collaboration<br />

How it works...<br />

While setting up the Nexus repository and configuring <strong>Apache</strong> <strong>Maven</strong> is complete, one critical<br />

aspect still remains. Nexus needs to be installed on the LAN so that everyone in the team can<br />

access it.<br />

Ideally, it should not reside on a development machine. A dedicated box, accessible on the<br />

LAN will be perfect. Setting up a LAN is obviously beyond the scope of this recipe. However,<br />

chances are that you are already on a LAN. In such a case, a preferred repository URL would<br />

be something like:<br />

http:///nexus-webapp-1.8.0/content/<br />

repositories/TestRepository/<br />

Out of all the repository managers available, Nexus is recommended because it is<br />

developed by Sonatype; which includes many core developers from <strong>Apache</strong> <strong>Maven</strong>.<br />

Hence, interoperability with various versions of <strong>Apache</strong> <strong>Maven</strong> is better supported.<br />

Repository managers are generally recommended, as they prevent the trouble of each<br />

developer uniquely downloading the same dependencies over and over again. Only a single<br />

download is required, and once downloaded, they are available to everyone in the team or<br />

organization. In large organizations with multiple projects, this ends up saving considerable<br />

bandwidth, and more importantly, developer time.<br />

Another advantage is that internal projects / artifacts can be deployed onto the team /<br />

organizational repository and each developer can access internal dependencies from the<br />

repository instead of having to clone and locally build the project.<br />

Performing continuous integration with<br />

Hudson<br />

In Chapter 2, Software Engineering Techniques, we saw how our project builds could be<br />

automated in the Build automation section. Now that we can build and test our project<br />

with a single command, the question of how often this should be done arises.<br />

"Ship It!" by Jared Richardson and William Gwaltney Jr. says:<br />

"Ideally, you will rebuild every time the code changes. That way you'll know<br />

immediately if any change broke your build."<br />

Sure, programmers always try and do it, but how often have you pulled an update from the<br />

SCM and forgotten to build before committing your code? To avoid this occurrence, builds can<br />

be triggered each time code is committed into the SCM. Such a setup is known as continuous<br />

integration. It has become extremely popular and is extremely effective for small and large<br />

teams working in an Agile environment.<br />

54

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!