Skip to content

Instantly share code, notes, and snippets.

@ilbonte
Last active January 24, 2017 13:23
Show Gist options
  • Save ilbonte/395da81563581f9adeee72447100e3b7 to your computer and use it in GitHub Desktop.
Save ilbonte/395da81563581f9adeee72447100e3b7 to your computer and use it in GitHub Desktop.
KIKSTART java development using maven

KIKSTART java development using maven

Requirements

  1. maven
  2. IntelliJ IDEA (optional?)

Steps

  1. Run mvn archetype:generate -DgroupId=it.xpeppers -DartifactId=INSERT-PROJECT-NAME -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

  2. Import the created project as a maven projecy

  3. Inside pom.xml set JUnit version to 4.12 (or latest stable) && enable auto import (promped by intellij)

  4. Delete the two classes created automatically

  5. Create a new class using this "template"

package it.xpeppers;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class CalcTest {
    @Test
    public void name() {
        assertEquals(1,1);
    }
}
  1. Run the code. The test should pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment