jjryu 2019. 12. 6. 19:27

${user.home}/.m2/repository
local repository

${basedir}/pom.xml
project's Project Object Model, or POM

${basedir}/src/main/java/ # /
project source code directory

${basedir}/src/main/resources/(META-INF/application.properties) # /META-INF/application.properties

${basedir}/src/test/java/
test source code directory

${basedir}/src/test/resources/(test.properties) # /(test.properties)

plugin - goal
archetype
> generate

phases
1. validate
2. generate-sources
3. process-sources
4. generate-resources
5. process-resources
6. compile

$ mvn --version

$ mvn -B archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.mycompany.app -DartifactId=my-app
$ mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false
$ mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DgroupId=com.mycompany.app -DartifactId=my-webapp

 

$ mvn eclipse:eclipse

$ mvn compile # ${basedir}/target/classes/

$ mvn test # mvn test-compile

$ mvn package # ${basedir}/target/${artifactId}-${version}.jar
$ java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App

$ mvn clean # ${basedir}/target/


$ mvn install # ${user.home}/.m2/repository


참조 사이트:

https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html

https://maven.apache.org/guides/getting-started/index.html