Maven notebook

Overview

Maven notebook

Quick topics

Maven is a standard tool used for building and managing any Java-based project.

Maven buils projects using what's called project object model (POM) an XML file that contains information about the project and configuration details used by Maven to build the project. When executing a task or goal, Maven looks for the POM in the current directory. It reads the POM, gets the needed configuration information, then executes the goal.

Maven provides guidelines for best practices development, in one of the most importants topics, tests. Maven keeps tests code in separate from source code, use test naming conventions to find tests and having test cases setup environment.

Install Maven

You must have Java installed in order to proceed.

Download

Ubuntu 20.04

sudo apt get install maven 

Next command should print installed Maven version

mvn -v
Maven home: /usr/share/maven
Java version: 1.8.0_312, vendor: Private Build, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: es_ES, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-96-generic", arch: "amd64", family: "unix"

Create a project

  • Quick topics
    • Archetype is the exemplpary pattern from which other objects, ideas, or concepts are derived. In few words, is the perfect model.

Create a folder and move into that folder, then open a terminal

mkdir my-folder
cd my-folder

Execute the following Maven instruction. Change it by your preferences.

mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false

Archetype is just a plugin that contains a collection of goals with a general common purpose. It just creates a simple project based upon a maven-archetype-quickstart archetype.

A new directory with the artifactId attribute name defined its created, move into that file and you will see basic Maven project structure.

maven-notebook-project
|-- pom.xml
`-- src
    |-- main
    |   `-- java
    |       `-- com
    |           `-- mycompany
    |               `-- app
    |                   `-- App.java
    `-- test
        `-- java
            `-- com
                `-- mycompany
                    `-- app
                        `-- AppTest.java

The src/main/java directory contains the project source code, the src/test/java directory contains the test source, and the pom.xml file is the project's Project Object Model, or POM.

You might also like...

JavaFX or Swing + jpackage + Maven template project for generating native desktop applications.

Java + Maven + GitHub Actions = Native Desktop Apps JavaFX or Swing + jpackage + Maven template project for generating native desktop applications. Go

Dec 24, 2022

Spring Boot Rest API unit test with Junit 5, Mockito, Maven

Spring Boot Rest API unit testing with Junit 5, Mockito, Maven Apply Spring Boot @WebMvcTest for Rest Controller Unit Test with JUnit 5 and Mockito. F

Dec 22, 2022

Spring-boot project using open-api, docker, maven, REST

library-service spring-boot project using open-api, docker, maven, REST I used docker to run the project, as well as open-api to generate basic GET an

Nov 27, 2022

An API Library that provides the functionality to access, manage and store device topologies found in JSON files using Java and Maven Framework

An API Library that provides the functionality to access, manage and store device topologies found in JSON files using Java and Maven Framework

Topology API šŸ“™ About An API library which provides the functionality to access, manage and store device topologies. šŸ“ Description Read a topology fr

Aug 4, 2022

Maven plugin to check if dependencies in CycloneDX BOM files use only allowed licenses.

license-checker-cyclonedx-maven-plugin Maven plugin to check if dependencies in CycloneDX BOM files use only allowed licenses. Quick start guide 1. Ad

Sep 17, 2022

This is a Maven plugin designed to help developers automatizing the creation of code classes from YML files based on AsyncApi and OpenAPI.

SCS MultiApi Maven Plugin This is a Maven plugin designed to help developers automatizing the creation of code classes from YML files based on AsyncAp

Dec 20, 2022

A Maven extension for validating and collecting checksums of all artifacts during execution.

Maven checksum extension This extension allows for the creation and the enforcement of checksums for any artifact that is resolved by Maven. Without s

Aug 6, 2022

Web-based notebook that enables data-driven, interactive data analytics and collaborative documents with SQL, Scala and more.

Apache Zeppelin Documentation: User Guide Mailing Lists: User and Dev mailing list Continuous Integration: Contributing: Contribution Guide Issue Trac

Jan 8, 2023

Paper-nms-maven-plugin - A maven plugin for using NMS on paper with Mojang mappings.

Paper-nms-maven-plugin - A maven plugin for using NMS on paper with Mojang mappings.

paper-nms-maven-plugin A maven plugin for using NMS on paper with Mojang mappings. This plugin will both create the mapped paper dependency and instal

Dec 28, 2022

:package: Gradle/Maven plugin to package Java applications as native Windows, Mac OS X, or GNU/Linux executables and create installers for them.

JavaPackager JavaPackager is a hybrid plugin for Maven and Gradle which provides an easy way to package Java applications in native Windows, Mac OS X

Jan 8, 2023

maven plugin for making chmod +x jar files

To use it, add a plugin to your pom like !-- You need to build an exectuable uberjar, I like Shade for that -- plugin groupIdorg.apache.mave

Dec 8, 2022

Launch4j Maven Plugin

Launch4j Maven Plugin

Dec 29, 2022

The easiest way to integrate Maven into your project!

Maven Wrapper Ongoing Migration to Apache Maven The project codebase has been accepted to be included in the upstream Apache Maven project itself. Cur

Dec 23, 2022

Support alternative markup for Apache Maven POM files

Overview Polyglot for Maven is a set of extensions for Maven 3.3.1+ that allows the POM model to be written in dialects other than XML. Several of the

Dec 17, 2022

Randomized Testing (Core JUnit Runner, ANT, Maven)

RANDOMIZED TESTING ================== JUnit test runner and plugins for running JUnit tests with pseudo-randomness. See the following for more infor

Dec 26, 2022

Apache Maven core

Apache Maven Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can man

Jan 2, 2023

Lib-Tile is a multi Maven project written in JavaFX and NetBeans IDE 8 and provides the functionalities to use and handle easily Tiles in your JavaFX application.

Lib-Tile is a multi Maven project written in JavaFX and NetBeans IDE 8 and provides the functionalities to use and handle easily Tiles in your JavaFX application.

Lib-Tile Intention Lib-Tile is a multi Maven project written in JavaFX and NetBeans IDE and provides the functionalities to use and handle easily Tile

Apr 13, 2022
Owner
eze
"Success is no accident. It is hard work, perseverance, learning, studying, sacrifice and most of all, love of what you are doing or learning to do." - Pele
eze
The shortest possible maven template / quickstarter for Java 16

The shortest possible Java 16 maven quickstarter The shortest possible Apache Maven template for Java 16 usage git clone https://github.com/AdamBien/j

Adam Bien 6 Nov 8, 2021
Apache Maven artifacts for bootstrapping new open-source projects

OSS Quickstart Apache Maven archetypes for bootstrapping new open-source projects. Think Maven Quickstart Archetype and friends, but more modern, comp

ModiTect 49 Dec 31, 2022
A base repo for creating RPC microservices in Java with gRPC, jOOQ, and Maven.

Wenower Core OSX local installation Install Protocol Buffer $ brew install protobuf Install Postgresql and joopc database and user $ brew install pos

Hamidreza Soleimani 1 Jan 9, 2022
This is simple project to show how to create a basic API using Java 11 + Maven + Spring Boot + PostgrSQL + Flyway.

This is simple project to show how to create a basic API using Java 11 + Maven + Spring Boot + PostgrSQL + Flyway.

Sean Maxwell 11 Dec 10, 2022
A Spigot latest maven starter template.

NAME One sentence to describe your plugin. Introduction Describe your plugin clearly. Features Feature 1 Dependencies Commands /command Command functi

Katorly Lab 3 Jul 1, 2022
Source codes of book Java Concurrency In Practice, rebuild by maven.

Introduction Source codes of book: Java Concurrency In Practice(2011, Brain Goetz etc. jcip for short.), rebuild from https://jcip.net/ with maven. Mo

Sam Sune 2 Jun 9, 2022
High level api to interact with maven form within the jvm

maven-utils High level api to interact with maven from within the jvm Use it by adding the dependency to your maven pom: <dependency> <groupId>se.

Alipsa 5 Sep 29, 2022
Projeto java + spring + maven +TDD

Java - Spring Framework Sistema simples para geraĆ§Ć£o de mensagens. ciclo do TDD (escreva um teste que falha, faƧa o teste passar e refatore); versiona

null 1 Apr 2, 2022
The Spring Boot Sample App on K8S has been implemented using GKE K8S Cluster, Spring Boot, Maven, and Docker.

gke-springboot-sampleapp ?? The Spring Boot Sample App on K8S has been implemented using GKE K8S Cluster, Spring Boot, Maven, and Docker. Usage To be

KYEONGMIN CHO 1 Feb 1, 2022
This is the java/Maven application we are building to solve one real world problem.

timly This is the java/Maven application we are building to solve one real world problem. As in MLH we are working with fellows across the globe and e

Osakpolor Obaseki 3 Feb 16, 2022