Apache Maven - RIP Tutorial 1 1: Apache Maven 2 2 2 Examples 2 2 2 3 BREW Mac OSX 3 2: Eclipse 4...
date post
30-Mar-2020Category
Documents
view
4download
0
Embed Size (px)
Transcript of Apache Maven - RIP Tutorial 1 1: Apache Maven 2 2 2 Examples 2 2 2 3 BREW Mac OSX 3 2: Eclipse 4...
Apache Maven
#maven
1
1: Apache Maven 2
2
2
Examples 2
2
2
3
BREW Mac OSX 3
2: Eclipse 4
Examples 4
Eclipse Maven 4
Eclipse M2Eclipse Maven . 4
Eclipse Maven 4
3: Maven EAR 5
5
Examples 5
EAR 5
4: Maven Surefire Plugin 6
6
Examples 6
JUnit Maven Surefire Java 6
5: Maven 9
9
Examples 9
Maven 9
6: Maven 12
12
12
Examples 12
Maven Maven 12
12
13
13
. 14
14
7: POM - 15
Examples 15
POM 15
POM 15
POM 16
8: taglist-maven-plugin FIXME / TODO . 17
17
Examples 17
pom.xml FIXME 17
9: 19
19
19
Examples 19
Nexus POM.xml 19
10: 21
Examples 21
.jar 21
11: 22
Examples 22
Maven Tomcat . 22
12: Maven 24
24
24
Examples 24
24
13: Maven 25
25
Examples 25
25
Maven 26
Maven-model plugin pom.xml 26
28
You can share this PDF with anyone you feel could benefit from it, downloaded the latest version from: apache-maven
It is an unofficial and free Apache Maven ebook created for educational purposes. All the content is extracted from Stack Overflow Documentation, which is written by many hardworking individuals at Stack Overflow. It is neither affiliated with Stack Overflow nor official Apache Maven.
The content is released under Creative Commons BY-SA, and the list of contributors to each chapter are provided in the credits section at the end of this book. Images may be copyright of their respective owners unless otherwise specified. All trademarks and registered trademarks are the property of their respective company owners.
Use the content presented in this book at your own risk; it is not guaranteed to be correct nor accurate, please send your feedback and corrections to [email protected]
https://riptutorial.com/ko/home 1
http://riptutorial.com/ebook/apache-maven https://archive.org/details/documentation-dump.7z mailto:[email protected]
1: Apache Maven :
Maven .
Maven .
• • • • • • •
(SDLC) .
: , () .
Maven , , .
(Maven) (Maven) .• , .• , , , •
1.0-β-2 () 2002-03-30
1.0 2004-07-13
2.0 2.0 2005-10-20
3.0 3.0 2010-10-08
Examples
Maven Maven .
zip tar.gz . .
JAVA_HOME JDK (JRE ) . Windows C:\Program Files\Java\jdk1.8.0_51 .• .• PATH bin (Maven 3.3.9 apache-maven-3.3.9 3.3.9) . ( Windows ).• mvn -version .•
M2_HOME MAVEN_HOME .
sudo apt-get install maven1.
https://riptutorial.com/ko/home 2
https://maven.apache.org/guides/getting-started/ https://maven.apache.org/guides/getting-started/ https://maven.apache.org/guides/getting-started/ https://maven.apache.org/guides/getting-started/ https://maven.apache.org/guides/getting-started/ https://maven.apache.org/guides/getting-started/ https://maven.apache.org/guides/getting-started/ https://maven.apache.org/guides/getting-started/ https://maven.apache.org/guides/getting-started/ https://maven.apache.org/guides/getting-started/ https://maven.apache.org/background/philosophy-of-maven.html https://maven.apache.org/background/philosophy-of-maven.html http://jakarta.apache.org/site/news/news-2002.html#0330.1 http://jakarta.apache.org/site/news/news-2002.html#0330.1 http://jakarta.apache.org/site/news/news-2002.html#0330.1 http://jakarta.apache.org/site/news/elsewhere-2004-2ndHalf.html#20040713.1 http://jakarta.apache.org/site/news/elsewhere-2004-2ndHalf.html#20040713.1 http://jakarta.apache.org/site/news/elsewhere-2004-2ndHalf.html#20040713.1 http://mail-archives.apache.org/mod_mbox/maven-users/200510.mbox/%3C4356C7AF.6080901%40apache.org%3E http://mail-archives.apache.org/mod_mbox/maven-users/200510.mbox/%3C4356C7AF.6080901%40apache.org%3E http://mail-archives.apache.org/mod_mbox/maven-users/200510.mbox/%3C4356C7AF.6080901%40apache.org%3E http://mail-archives.apache.org/mod_mbox/maven-announce/201010.mbox/%3C4CAF1861.4030006%40apache.org%3E http://mail-archives.apache.org/mod_mbox/maven-announce/201010.mbox/%3C4CAF1861.4030006%40apache.org%3E http://mail-archives.apache.org/mod_mbox/maven-announce/201010.mbox/%3C4CAF1861.4030006%40apache.org%3E https://maven.apache.org/download.cgi https://maven.apache.org/download.cgi https://maven.apache.org/download.cgi https://maven.apache.org/download.cgi https://maven.apache.org/download.cgi https://maven.apache.org/download.cgi https://maven.apache.org/download.cgi https://maven.apache.org/download.cgi https://maven.apache.org/install.html https://maven.apache.org/install.html https://maven.apache.org/install.html https://maven.apache.org/install.html https://maven.apache.org/install.html http://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them http://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them http://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them http://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them http://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them http://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them http://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them
.
mvn -v . .
Apache Maven 3.3.9 Maven home: /usr/share/maven Java version: 1.8.0_121, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "4.8.0-parrot-amd64", arch: "amd64", family: "unix"
2.
JDK . javac -version
Maven jar .
Maven {Maven install location} → conf → settings.xml . .
Eclipse
Eclipse Maven settings.xml , → → (Maven) → → : . {Maven } → conf → settings.xml .
IntelliJ
(Maven) -> (Importing) . ( IntelliJ , , -> -> .)
" VM " :
-DproxySet=true -DproxyHost= -DproxyPort= -DproxySet=true -DproxyHost=myproxy.com -DproxyPort=8080
IntelliJ .
BREW Mac OSX
brew install maven1. maven mvn -v maven . .2.
Apache Maven 3.3.9 Maven home: /usr/local/Cellar/maven/3.3.9/libexec Java version: 1.8.0_121, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "10.12.4", arch: "x86_64", family: "mac"
JDK . javac -version
Apache Maven : https://riptutorial.com/ko/maven/topic/898/apache-maven-
https://riptutorial.com/ko/home 3
https://riptutorial.com/ko/maven/topic/898/apache-maven-%EC%8B%9C%EC%9E%91%ED%95%98%EA%B8%B0 https://riptutorial.com/ko/maven/topic/898/apache-maven-%EC%8B%9C%EC%9E%91%ED%95%98%EA%B8%B0 https://riptutorial.com/ko/maven/topic/898/apache-maven-%EC%8B%9C%EC%9E%91%ED%95%98%EA%B8%B0 https://riptutorial.com/ko/maven/topic/898/apache-maven-%EC%8B%9C%EC%9E%91%ED%95%98%EA%B8%B0 https://riptutorial.com/ko/maven/topic/898/apache-maven-%EC%8B%9C%EC%9E%91%ED%95%98%EA%B8%B0
2: Eclipse
Examples
Eclipse Maven
M2Eclipse Eclipse Apache Maven . Maven Eclipse .
Eclipse → ... .1.
... .2.
OK .
: M2Eclipse
: http://download.eclipse.org/technology/m2e/releases
3.
... .4.
◉ .5.
Eclipse . .6.
Eclipse M2Eclipse Maven .
→ Eclipse → m2e . .
Eclipse Maven
Maven , Maven (, ) . , . Maven IDE .
→ → → .•
/ / Maven .•
.
: ... your Maven home ... ...
: Apache Maven xyz
•
☑ EMBEDDED .•
Eclipse : https://riptutorial.com/ko/maven/topic/2315/eclipse-
https://riptutorial.com/ko/home 4
http://www.eclipse.org/m2e/ https://www.eclipse.org/m2e/ https://www.eclipse.org/m2e/ https://www.eclipse.org/m2e/ https://riptutorial.com/ko/maven/topic/2315/eclipse-%ED%86%B5%ED%95%A9 https://riptutorial.com/ko/maven/topic/2315/eclipse-%ED%86%B5%ED%95%A9 https://riptutorial.com/ko/maven/topic/2315/eclipse-%ED%86%B5%ED%95%A9
3: Maven EAR .war .jar Maven .
Examples
EAR
{ejbModuleGroupId} {ejbModuleArtifactId} {ejbModuleVersion} ejb {webModuleGroupId} {webModuleArtifactId} {webModuleVersion} war org.apache.maven.plugins maven-ear-plugin 2.9.1 1.4 {ejbModuleGroupId} {ejbModuleArtifactId}