Apache Maven is a cool java project management tool that I recently came across at work. I was asked to set-up a test suite for our low latency Market Data System project using an existing test framework built using TestNG. I was handed over something called a pom.xml file and that was it! Using IntelliJ IDE you can import this pom.xml as a Maven project and everything is basically set-up for you. The folder structure is pretty standard in Maven so that every developer get the same same project structure. I think the main advantage of maven is that it is a great way of managing dependencies. Imagine that something changes in the the so called test framework. The framework developers update the repository and when I re-export the pom file updates the correct jar file will already be in my project. By changing the SNAPSHOT version of the pom.xml file I can switch through different versions of the test framework and other dependencies. Maven will first look for dependencies in the internal repository and then go for global repository to find the specified dependencies. You can set different configurations in the POM file, per user or globally using different settings files.
For our work, we didn't really use all the life cycle phases of maven because we only really needed to run the TestNG test suite as the Market Data System was written in C++ and was running on back-end servers. Separate connections has to be made to these back-end via the test framework to enable testing. However it will be pretty cool if a fully fledged end-to-end project can be built for java based project with all the TestNG unit tests integrated and you can end up with deploying your jar to the client using the deploy plug-in! (Note that mvn-test in the image should point to test phase not package in the image)
Comments
Post a Comment