[JAVA] How to make a Maven project

How to make a Maven project

generate


 If you execute the above command at the terminal command prompt, the Maven project will start to be created. (* Maven must be installed. In my case, I installed it with homebrew.)
 Then you will be asked the following, so I will answer as follows.

```choose a number or apply filter```
 The above message comes out. This is the group ID specification.
 Enter if you don't need to set the filter.


#### **`Choose org.apache.maven.archetypes:maven-archetype-quickstart version:`**

Select the version you want to use from the list. Enter if there is nothing in particular.

Define value for property ‘groupId’::


 This is the project group ID.
 Basically specify the package to place the program to be created.
 Enter the package name appropriately
 (Example: jp.tuyano.spring.sample1)


#### **`Define value for property ‘artifactId’::`**

Enter the Artifact ID. Enter the name of the project. (Example: MySampleApp1)

Define value for property ‘version’: 1.0-SNAPSHOT::


 Version name. 1.0-SNAPSHOT is specified by default.
 Enter if you don't need to change it.


#### **`python`**
```define value for property ‘package’

 The one you entered with the group ID earlier is set by default, so press Enter.

 Next, check the contents. You will be asked in Y / N, so if you are not wrong, Y

---
## Build by Maven

```$cd project name (mysampleapp1)
$mvn install```
 An instruction to package a program and install it in a local repository.
 It downloads the required libraries and organizes the project into a specified package file.

 If you want to compile the program, mvn compile,
 If you want to create a package, mvn package
 There are commands such as.
 I think you should check this area as appropriate.

---
## Run by Maven
```$cd target```

#### **`$java -classpath ./MySampleApp1-1.0-SNAPSHOT.jar jp.tuyano.spring.sample1.App`**

"/" Is used, but the "/" part needs to be changed depending on the OS. https://stackoverflow.com/questions/4528438/classpath-does-not-work-under-linux

Recommended Posts

How to make a Maven project
How to make a Java container
How to make a JDBC driver
How to make a splash screen
How to make a Jenkins plugin
How to make a Java array
How to make a Java calendar Summary
How to create a Maven repository for 2020
How to make a Discord bot (Java)
How to make a hinadan for a Spring Boot project using SPRING INITIALIZR
How to make a jar file with no dependencies in Maven
How to make a lightweight JRE for distribution
[1st] How to create a Spring-MVC framework project
How to make a follow function in Rails
Java --How to make JTable
Introduce Maven to Tomcat project
[Rails] How to make seed
How to insert a video
How to create a method
How to make a factory with a model with polymorphic association
How to create a Spring Boot project in IntelliJ
[Spring Boot] How to create a project (for beginners)
How to make JavaScript work on a specific page
How to make a cache without thinking too much
How to make a mod for Slay the Spire
How to change a TERASOLUNA 5.x blank project to support PostgreSQL
How to sign a Minecraft MOD
Learning Ruby with AtCoder 13 How to make a two-dimensional array
[Java] How to create a folder
How to write a ternary operator
[Swift] How to send a notification
Try to make a peepable iterator
Create a Maven project with a command
[Android] How to make Dialog Fragment
How to identify the path that is easy to make a mistake
How to make a groundbreaking diamond using Java for statement wwww
[Xcode] How to add a README.md file
How to execute a contract using web3j
How to add local jar to maven pom.xml
How to sort a List using Comparator
A memorandum on how to use Eclipse
How to redo a deployment on Heroku
[Basic] How to write a Dockerfile Self-learning ②
How to insert a video in Rails
[Introduction to Java] How to write a Java program
Added slf4J + logback to Eclipse Maven project
How to set JAVA_HOME with Maven appassembler-maven-plugin
[Java] [Maven3] Summary of how to use Maven3
How to print a Java Word document
[Swift5] How to create a splash screen
[rails] How to create a partial template
How to make asynchronous pagenations using Kaminari
How to publish a library in jCenter
[SpringBoot] How to write a controller test
Create Maven Project
How to deploy
JVM Performance Tuning: What is Tuning and How to Make a Good Plan
How to make an app with a plugin mechanism [C # and Java]
Rails: How to write a rake task nicely
How to create a database for H2 Database anywhere
[Rails] How to write when making a subquery