Maven 권위 가이드 학습 노트 (1 - 8 장)
(1) mavn
1、
mvn archetype:create -DgroupId=org.sonatype.mavenbook.ch03 -DartifactId=simple -DpackageName=org.sonatype.mavenbook
2、 mvn package :( , mavn , )
resources:resources \
compiler:compile \
resources:testResources \
compiler:testCompile \
surefire:test \
jar:jar
3、maven ( pom.xml )
<groupId>org.sonatype.mavenbook.ch03</groupId>
<artifactId>simple</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
4、 eclipse
(1):
mvn eclipse:eclipse
(2): eclipse , jar (window (C:\Documents and Settings\${username}\.m2\repository)
mvn eclipse:eclipse -DdownloadSources=true
(3):path-to-eclipse-workspace eclipse worksapce 。 maven eclipse M2_REPO , jar ,
mvn -Declipse.workspace=<path-to-eclipse-workspace> eclipse:add-maven-repo
5、 main
mvn install
mvn exec:java -Dexec.mainClass=org.sonatype.mavenbook.weather.Main
6、
mvn help:describe -Dplugin=exec -Dfull
7、
mvn dependency:resolve
8、
mvn dependency:tree
9、
mvn install -X
10、
mvn test
11、
mvn test -Dmaven.test.failture.ignore=true
12、
mvn install -Dmaven.test.skip=true
13、Maven Assembly JAR , 。
:mvn install assembly:assembly
14、 jar :
java -cp simple-weather-jar-width-dependency.jar org.sonatype.mavenbook.weather.Main
: , mvn install , eclipse 。
(2) web
1、 web :
mvn archetype:create -DgroupId=org.sonatype.mavenbook.ch05 -DartifactId=simple-webapp -DpackageName=org.sonatype.mavenbook.web -DarchetypeArtifactId=mavn-archetype-webapp
2、 Maven Jetty , Maven web
mvn jetty:run
3、
mvn clean install
(3)
(1)
, 。 , <relativePath> pom.xml 。
jar , , , groupId、version 。
simple-parent——————————simple—weather
|
———————simple-webapp
:
1、simple-parent
<modules>
<module>simple-weather</module>
<module>simple-webapp</module>
</modules>
2、simple—weather
<!-- groupId version , -->
<parent>
<groupId>org.sonatype.mavenbook</groupId>
<artifactId>simple-parent</artifactId>
<version>1.0</version>
</parent>
<artifactId>simple-weather</artifactId>
<packaging>jar</packaging>
<name>Simple-Weather</name>
3、simple-webapp
<!-- groupId version , -->
<parent>
<groupId>org.sonatype.mavenbook</groupId>
<artifactId>simple-parent</artifactId>
<version>1.0</version>
</parent>
<artifactId>simple-webapp</artifactId>
<packaging>war</packaging>
<name>simple-webapp</name>
<url>http://maven.apache.org</url>
simple-webapp simple—weather, <dependences>
<!-- weather , weather -->
<dependency>
<groupId>org.sonatype.mavenbook</groupId>
<artifactId>simple-weather</artifactId>
<version>1.0</version>
</dependency>
|——simple-parent
|——simple—weather
|——simple-webapp
:
1、simple-parent
<modules>
<module>../simple-weather</module>
<module>../simple-webapp</module>
</modules>
2、simple—weather
<!-- groupId version , -->
<parent>
<groupId>org.sonatype.mavenbook</groupId>
<artifactId>simple-parent</artifactId>
<version>1.0</version>
<!-- simpe-parent -->
<relativePath>../simple-parent/pom.xml</relativePath>
</parent>
<artifactId>simple-weather</artifactId>
<packaging>jar</packaging>
<name>Simple-Weather</name>
3、simple-webapp
<!-- groupId version , -->
<parent>
<groupId>org.sonatype.mavenbook</groupId>
<artifactId>simple-parent</artifactId>
<version>1.0</version>
<!-- simpe-parent -->
<relativePath>../simple-parent/pom.xml</relativePath>
</parent>
<artifactId>simple-webapp</artifactId>
<packaging>war</packaging>
<name>simple-webapp</name>
<url>http://maven.apache.org</url>
simple-webapp simple—weather, <dependences>
<!-- weather , weather -->
<dependency>
<groupId>org.sonatype.mavenbook</groupId>
<artifactId>simple-weather</artifactId>
<version>1.0</version>
</dependency>
(4)
1、 jar parent pom.xml , properties , jar ,
:
<properties>
<hibernate.annotations.version>3.3.0.ga</hibernate.annotations.version>
<hsqldb.version>1.8.0.7</hsqldb.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>${hibernate.annotations.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>${hibernate.annotations.version}</version>
</dependency>
<dependencies>
<dependencyManagement>
:
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>simple-model</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jta_1.1_spec</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
</dependency>
</dependencies>
2、 grouId version,
<parent>
<groupId>org.sonatype.mavenbook</groupId>
<artifactId>simple-parent</artifactId>
<version>1.0</version>
<!-- simpe-parent -->
<relativePath>../simple-parent/pom.xml</relativePath>
</parent>
<artifactId>simple-persist</artifactId>
<packaging>jar</packaging>
, :
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>simple-model</artifactId>
<version>${project.version}</version>
</dependency>
3、 mvn dependency:analyze 。
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
m1 이클립스에 oracle cloud (오라클 클라우드)연결하기m1에는 oracle이 설치되지 않는다.... 큰맘먹고 지른 m1인데 oracle이 설치되지 않는다니... 하지만 이뻐서 용서가 된다. 이거 때문에 웹 개발 국비수업을 듣는 도중에 몇번 좌절하고 스트레스를 크게 받았...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.