maven笔记

时间:2019-09-15
本文章向大家介绍maven笔记,主要包括maven笔记使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

安装  M2_HOME环境变量必须配置

mvn -h  //帮助文档

阿里中央仓库

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>jetty-maven-plugin</artifactId>
  <configuration>
    <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>

原文地址:https://www.cnblogs.com/xinghe1/p/11523673.html