Maven配置

1.下载Maven插件。
 http://m2eclipse.sonatype.org/sites/m2e
 
2.新建文件settings.xml

 <settings> 
 
   <proxies> 
   <proxy> 
   <id>https-proxy</id> 
      <active>true</active> 
      <protocol>https</protocol> 
      <host>172.19.200.101</host> 
      <port>10002</port> 
      <nonProxyHosts>localhost|172.*</nonProxyHosts> 
    </proxy> 
   
  </proxies> 
 
 <profiles> 
 <profile> 
  <id>yanfeng</id> 
 <activation> 
  <activeByDefault>true</activeByDefault> 
  </activation> 
 <pluginRepositories> 
 <pluginRepository> 
  <id>mavencentral</id> 
  <url>http://172.19.200.101/archiva/repository/internal</url> 
 <snapshots> 
  <enabled>false</enabled> 
  </snapshots> 
 <releases> 
  <enabled>true</enabled> 
  </releases> 
  </pluginRepository> 
 <pluginRepository> 
  <id>snapcentral</id> 
  <url>http://172.19.200.101/archiva/repository/snapshots</url> 
 <snapshots> 
  <enabled>true</enabled> 
  </snapshots> 
 <releases> 
  <enabled>false</enabled> 
  </releases> 
  </pluginRepository> 
  </pluginRepositories> 
 <repositories> 
 <repository> 
  <id>localrelease</id> 
  <name>localrelease</name> 
  <url>http://172.19.200.101/archiva/repository/internal</url> 
 <snapshots> 
  <enabled>false</enabled> 
  </snapshots> 
  </repository> 
 <repository> 
  <id>localsnapshot</id> 
  <name>localsnapshot</name> 
  <url>http://172.19.200.101/archiva/repository/snapshots</url> 
 <snapshots> 
  <enabled>true</enabled> 
  </snapshots> 
  </repository> 
 
  </repositories> 
  </profile> 
 
                <profile> 
                        <id>jnolen-devnet-profile</id> 
                        <activation> 
                  <activeByDefault>false</activeByDefault> 
                        </activation> 
                        <repositories> 
                                <repository> 
                                        <id>atlassian-public</id> 
                                        <url>https://maven.atlassian.com/repository/public</url> 
                                        <snapshots> 
                                                <enabled>true</enabled> 
                                        </snapshots> 
                                        <releases> 
                                                <enabled>true</enabled> 
                                        </releases> 
                                </repository>   
                                <repository> 
                                        <id>atlassian-m1-repository</id> 
                                        <url>https://maven.atlassian.com/maven1</url> 
                                        <layout>legacy</layout> 
                                </repository> 
                        </repositories> 
                        <pluginRepositories> 
                                <pluginRepository> 
                                        <id>atlassian-public</id> 
                                        <url>https://maven.atlassian.com/repository/public</url> 
                                        <snapshots> 
                                                <enabled>true</enabled> 
                                        </snapshots> 
                                        <releases> 
                                                <enabled>true</enabled> 
                                        </releases> 
                                </pluginRepository> 
                        </pluginRepositories> 
                        <properties> 
                                <downloadSources>true</downloadSources> 
                                <downloadJavadocs>true</downloadJavadocs> 
                                <!-- 
                                  Uncomment this and specify the location on your file system where your 
                                  clover license is located.
                                  <clover.licenseLocation>/path/to/clover/license</clover.licenseLocation>
                                --> 
                                <atlassian.pdk.server.url>http://localhost:1990/confluence/</atlassian.pdk.server.url> 
                                <atlassian.pdk.server.username>admin</atlassian.pdk.server.username> 
                                <atlassian.pdk.server.password>admin</atlassian.pdk.server.password> 
                        </properties> 
      
                </profile> 
 
  </profiles> 
  </settings> 
 
 将文件拷贝至目录C:\Documents and Settings\Administrator\.m2下
 
 
 2.重新启动Eclipse,Window-->Maven-->User Settings-->选择settings.xml,Update Settings-->Apply-->OK
 
 
 3.New Project-->Maven Project-->Next-->Next-->在Filter中输入webapp,选择webapp-jee5-->Next-->输入Group Id和Artifact Id-->Finish
 
 
 4.打开pom.xml,选择Dependencies视图,添加需要的jar包。
 
 
 5.关闭pom.xml,重新打开pom.xml(我安装的时候有这个Bug,添加插件无响应),选择Plugins视图,Add插件,输入tomcat,选择1.0版本,Ok。
 
 
 6.配置tomcat插件的端口,选择pom.xml视图,更改:
 <plugin>
   <groupId>org.codehaus.mojo</groupId>
    <artifactId>tomcat-maven-plugin</artifactId>
    <version>1.0</version>
    <configuration>
      <port>8088</port>
    </configuration>
 </plugin>
 
 7.配置运行环境
 src-->main-->webapp-->index.jsp右击-->run as-->run Configurations-->输入Name:选择Browse workspace,在Goals:中输入tomcat:run,点击run。
 
 8.验证:浏览器中输入http://localhost:8088/training,查看结果!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值