Maven学习笔记1
来源:百度文库 编辑:神马文学网 时间:2024/06/30 22:20:15
1,下载Maven:http://maven.apache.org/download.html2.安装配置 Windows 2000/XP
-DartifactId=simple \
-DpackageName=org.sonatype.mavenbook 2)构建简单项目:mvn install 3) 站点生成和报告:mvn side
项目的整个依赖树:mvn dependency:tree 7)执行测试: mvn test 忽略测试失败:1)
or
...
3.3.0.ga
...
org.hibernate
hibernate-annotations
${hibernate.annotations.version}
org.hibernate
hibernate-commons-annotations
${hibernate.annotations.version}
...
...
...
3.3.0.ga
1.8.0.7
...
...
org.apache.maven.plugins
maven-compiler-plugin
1.5
1.5
org.codehaus.mojo
hibernate3-maven-plugin
2.1
hbm2ddl
annotationconfiguration
hsqldb
hsqldb
${hsqldb.version}
...
- Unzip the distribution archive, i.e. apache-maven-2.2.1-bin.zip to the directory you wish to install Maven 2.2.1. These instructions assume you chose C:\Program Files\Apache Software Foundation. The subdirectory apache-maven-2.2.1 will be created from the archive.
- Add the M2_HOME environment variable by opening up the system properties (WinKey + Pause), selecting the "Advanced" tab, and the "Environment Variables" button, then adding the M2_HOME variable in the user variables with the value C:\Program Files\Apache Software Foundation\apache-maven-2.2.1. Be sure to omit any quotation marks around the path even if it contains spaces. Note: For Maven < 2.0.9, also be sure that the M2_HOME doesn't have a '\' as last character.
- In the same dialog, add the M2 environment variable in the user variables with the value %M2_HOME%\bin.
- Optional: In the same dialog, add the MAVEN_OPTS environment variable in the user variables to specify JVM properties, e.g. the value -Xms256m -Xmx512m. This environment variable can be used to supply extra options to Maven.
- In the same dialog, update/create the Path environment variable in the user variables and prepend the value %M2% to add Maven available in the command line.
- In the same dialog, make sure that JAVA_HOME exists in your user variables or in the system variables and it is set to the location of your JDK, e.g. C:\Program Files\Java\jdk1.5.0_02 and that %JAVA_HOME%\bin is in your Path environment variable.
- Open a new command prompt (Winkey + R then type cmd) and run mvn --version to verify that it is correctly installed.
-DartifactId=simple \
-DpackageName=org.sonatype.mavenbook 2)构建简单项目:mvn install 3) 站点生成和报告:mvn side
4)为 pom.xml 添加组织,法律和开发人员信息5)运行项目:mvn exec:java -Dexec.mainClass=org.sonatype.mavenbook.weather.Main 6)浏览项目依赖:mvn dependency:resolvexmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
...simple-weather http://www.sonatype.com Apache 2 http://www.apache.org/licenses/LICENSE-2.0.txt repo A business-friendly OSS license Sonatype http://www.sonatype.com jason Jason Van Zyl jason@maven.org http://www.sonatype.com Sonatype http://www.sonatype.com developer -6
...
项目的整个依赖树:mvn dependency:tree 7)执行测试: mvn test 忽略测试失败:1)
8)跳过单元测试 mvn install -Dmaven.test.skip=true2)mvn test -Dmaven.test.failure.ignore=true
[...]org.apache.maven.plugins maven-surefire-plugin true
[...]
or
9)构建一个打包好的命令行应用程序 :
[...]org.apache.maven.plugins maven-surefire-plugin true
[...]
1.9)优化和重构POM
[...]maven-assembly-plugin jar-with-dependencies
[...]
2 . mvn install assembly:assembly
...
...
...
...
...
...
...
...
Maven学习笔记1
Better Builds With Maven 学习笔记(使用Maven创建应用 )
Better Builds With Maven 学习笔记(使用Maven创建应用 ) -...
Maven学习笔记2——向repository上传artifact
学习maven的使用
Log4J 学习笔记1
MySQL学习笔记1
JDBC 学习笔记1
MySQL学习笔记1
学习笔记,盘口1
HLA学习笔记(1)
EasyTime - Ruby学习笔记1
Maven 2的一些学习资源
Maven 2的一些学习资源
学习笔记
学习笔记
学习笔记
我的Maven之旅(1)-为什么使用maven
TCP/IP详解学习笔记(1)-基本概念
Spring学习笔记:1、概念理解
Div+CSS样式布局学习笔记(1)
Spring学习笔记:1、概念理解
软件测试学习笔记(1)
《英语单词看天下》学习笔记(1)