maven插件

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>
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容