Tag: Maven
-
Maven: Enabling Snapshot Downloads
By default, Maven does not allow us to download snapshots. To enable this feature so that we can download snapshots from Nexus, add the following configuration to [USER.HOME]/.m2/settings.xml:- Replace http://snapshots with the actual snapshot link. Read More…
-
Spring Web Services: Client Integration Testing with MockWebServiceServer
Spring Web Services provides a great way to perform web service client integration tests. However, the example in the documentation requires the client class to extend org.springframework.ws.client.core.support.WebServiceGatewaySupport, which is rather ugly. Instead, I prefer to have WebServiceTemplate injected into my client class. So, I made a slight tweak to my integration test to work this… Read More…
-
Maven: Building Specific Module in Multi-Module Project
Let’s assume we have a multi-module project that looks something like this:- To build certain module(s) within the project, we can use the -pl option. For example, the following mvn command will only build app-jar module:- Read More…
-
Maven: Excluding All Transitive Dependencies
I have been using Maven 3.0.3 on my work machine since 2011 because that particular version was released in March that year. How time flies by… Maven 3.2.1 was released exactly a month ago. One feature that immediately jumps out is the ability to exclude a dependency’s transitive dependencies in a very simple manner, which… Read More…
-
Suppressing FindBugs Warnings
PROBLEM FindBugs is one of the many great static code analysis tools that I use everyday. However, the generated report may usually contain a few false positives that forces me to weave through them whenever I rerun my build on Jenkins. For example, I’m using Google Guava to construct my equals(…) and hashCode():- FindBugs will… Read More…
-
How to Unit Test Spring MVC Controller
SCENARIO Let’s assume we have the following controller that needs to be tested:- SOLUTION 1: “Works but It Won’t Get You the Promotion” This working solution relies on:- While this solution works, but it has a few problems. This test case strictly tests the actual controller API, but it completely disregards the URI and request… Read More…