concept Maven in category groovy

appears as: Maven, Maven
Groovy in Action, Second Edition

This is an excerpt from Manning's book Groovy in Action, Second Edition.

Groovy will be your house elf for all automation tasks that you’re likely to have in your projects. These range from simple build automation, continuous integration (CI), and reporting, up to automated documentation, shipment, and installation. The Groovy automation support leverages the power of existing solutions such as Ant, Maven, and Gradle while providing a simple and concise language means to control them. Groovy even helps with testing, both at the unit and functional levels, helping us test-driven folks feel right at home.

  • Tests written in Groovy can be easily run from Gradle, Maven, or your favorite IDE.
  • 17.8.2. Build integration with Maven

    Apache Maven is a software project-management framework that can help you manage the many activities associated with producing a project’s deliverable artifacts. This may include acquiring your project’s dependent software, compiling your software, testing it, packaging it, and generating test and metrics reports. Two main versions of Maven are in use today: Maven 2 (versions 2.0 and above) and Maven 3 (versions 3.0 and above).

    Maven supports the concept of plug-ins to perform many of the project lifecycle activities that it manages for you. For example, there are plug-ins to compile Java files, test them, package them up as jar files, and so forth. Because Groovy tests are easily compiled to normal Java bytecode, it should come as no surprise that you can leverage many of the existing Maven Java tasks to assist you. Plus, there are purpose-built Maven tasks for Groovy that you can utilize.

    Listing 17.21. Updating Maven’s pom.xml file and adding a Groovy dependency
    <dependencies> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</scope> </dependency> </dependencies>