Giter Club home page Giter Club logo

maven-kata's Introduction

Maven Kata

The aim of this project is to provide a frame for some simple Maven related exercises.

Project structure

Project is build from three independent modules:

  • calculator: The main app, uses interfaces from calculator-api. You need to create this project.
  • calculator-api: provides a basic API for a calculator app.
  • calculator-test: tests for the app.

The assignment is to implement the calculator in a few, maven related steps (a little Java code with a lot of maven based steps).

Exercises

  1. Install Maven, if its not on your PC yet (You can use apt on Ubuntu). Verify that its installed by running mvn -v in a terminal.
  2. Clone this project.
  3. Create new maven project in the root folder with maven-archetype-quickstart: mvn archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart Use the following parameters:
   groupId: com.example.maven.calculator
   artifactId: calculator
   version: 1.0-SNAPSHOT

Make a new empty project in IDEA and import all 3 Maven projects as existing modules from the pom.xml files.
You might need to install your new calculator project, you can do this either from the console (see below) or in the Maven Projects tab in IDEA (its on the right side)
In the pom.xml files adjust the following:

  1. Study the pom files and remove unneeded dependencies from them.
  2. set java source and target runtime to Java 8.0. ย 
  3. Install locally: Install the calculator-api project locally with mvn clean install. You can verify that its installed by checking in your <home>/.m2 folder.
  4. change junit to latest available version (find it on Maven Central).
  5. add calculator-api as a dependency in the generated project
  6. Implement the calculator (Run the project with mvn clean package)
  7. Test the code: Check with the reference calculator-test project if everything works fine. First build the project with skipping tests: -DskipTest=true. Depending which calculator you've implemented test it with run a desired test. For Double calculator run mvn test -Dtest=DoubleCalculatorTest
  8. Bonus exercise: compress your build directory into a .rar file with the rar Maven plugin.

maven-kata's People

Contributors

matyasf avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.