美文网首页
maven插件

maven插件

作者: Mooner_guo | 来源:发表于2016-07-24 12:14 被阅读36次

maven插件需要放到<build>标签中,使用<plugins>管理

plugin插件样例.png

一、跳过test

打包如service层,service写了UT的话,会默认执行一遍test,可以通过配置plugin。

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
        <skip>true</skip>
    </configuration>
</plugin>

二、 jetty插件

项目开发过程中,可以通过运行mvn jetty:run命令来启动maven项目的jetty插件来做服务器使用,省得配置tomcat了。

<plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>maven-jetty-plugin</artifactId>
    <version>6.1.10</version>
    <configuration>
        <connectors>
            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                <port>9020</port>
            </connector>
        </connectors>
        <stopPort>9021</stopPort>
        <stopKey>a</stopKey>
        <scanIntervalSeconds>0</scanIntervalSeconds>
        <contextPath>/</contextPath>
    </configuration>
</plugin>

相关文章

网友评论

      本文标题:maven插件

      本文链接:https://www.haomeiwen.com/subject/jvowjttx.html