maven笔记

POM(Project Object Model)项目对象模型

安装  M2_HOME环境变量必须配置

mvn -h  //帮助文档

mvn archetype:generate

 

 

阿里中央仓库

1 <mirror>
2   <id>nexus-aliyun</id>
3    <mirrorOf>central</mirrorOf>
4    <name>Nexus aliyun</name>
5   <url>http://maven.aliyun.com/nexus/content/groups/public</url>
6 </mirror>

 

部署工具

Jetty容器

错误

1.No plugin found for prefix 'jerry' in the current project and in the plugin groups.

解决方法

mvn org.mortbay.jetty:maven-jetty-plugin:run

 

settings.xml 配置文件

1 <pluginGroups>
2     <pluginGroup>org.mortbay.jetty</pluginGroup>
3 </pluginGroups>

pom.xml 配置信息

<plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <configuration>
        <webApp>
            <contextPath>/</contextPath>  <!--此处为项目的上下文路径-->
        </webApp>
        <stopKey>webx</stopKey>
        <stopPort>9999</stopPort>
        <connectors>
            <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                <port>8080</port>  <!--此处配置了访问的端口号-->
                <maxIdleTime>60000</maxIdleTime>
            </connector>
        </connectors>
    </configuration>
</plugin>

 

<plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId>
        <configuration>
          <webDefaultXml>src/main/resources/jetty/webdefault.xml</webDefaultXml>
          <webAppSourceDirectory>src/main/webapp</webAppSourceDirectory>
          <scanIntervalSeconds>3</scanIntervalSeconds>
          <contextPath>/</contextPath>
          <connectors>
            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
              <port>4000</port>
            </connector>
          </connectors>
        </configuration>
</plugin>

 

Tomcat容器

tomcat:deploy --部署一个web war包
tomcat:reload --重新加载web war包
tomcat:start --启动tomcat
tomcat:stop --停止tomcat
tomcat:undeploy--停止一个war包
tomcat:run 启动嵌入式tomcat ,并运行当前项目

 

tomcat热部署配置

 

pom依赖范围

 

转载于:https://www.cnblogs.com/xinghe1/p/11523673.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值