maven 之初使用

来源:互联网 发布:手机隐藏桌面图标软件 编辑:程序博客网 时间:2024/06/05 19:38
下载地址:http://maven.apache.org/download.cgi
1、下载解压文件到目录
2、配置环境变量M2_HOME变量值为“目录\apache-maven-版本号”
3、在path变量后面加上“;%M2_HOME%\bin”
4、使用mvn -version 验证是否安装成功
5、添加maven库(推荐使用开源中国maven库)。打开maven安装路径下config文件夹中的settings.xml文件,
     (1)找到mirrors元素,添加开源中国mirror(可以指向本地maven库):
           <mirror>
               <id>nexus-osc</id>
               <mirrorOf>*</mirrorOf>
               <name>Nexus osc</name>
               <url>http://maven.oschina.net/content/groups/public/</url>
          </mirror>
     (2)找到profiles元素,添加插件下载指向开源中国:
       <profile>


         <id>jdk-1.4</id>
            
                <activation>
                        <jdk>1.4</jdk>
                </activation>
            
                <repositories>
                        <repository>
                                <id>nexus</id>
                                <name>local private nexus</name>
                                <url>http://maven.oschina.net/content/groups/public/</url>
                                <releases>
                                        <enabled>true</enabled>
                                </releases>
                                <snapshots>
                                        <enabled>false</enabled>
                                </snapshots>
                        </repository>
                </repositories>
                <pluginRepositories>
                        <pluginRepository>
                                <id>nexus</id>
                                <name>local private nexus</name>
                                <url>http://maven.oschina.net/content/groups/public/</url>
                                <releases>
                                        <enabled>true</enabled>
                                </releases>
                                <snapshots>
                                        <enabled>false</enabled>
                                </snapshots>
                        </pluginRepository>
                </pluginRepositories>
            </profile>


6、创建测试demo 
mvn archetype:create -DgroupId=yyc -DartifactId=simple -DpackageName=com.yyc.simple  -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false




svn eclipse插件


svn_1.10 - http://subclipse.tigris.org/update_1.10.x
0 0
原创粉丝点击