maven jetty配置

版权声明:任先阳 任 先 阳 任先 先阳,ifgm.cn、www.ifgm.cn、nvcc.cc、www.nvcc.cc、sbfox.com、www.sbfox.com https://blog.csdn.net/qq_39571197/article/details/86214159

版本:9.4.14.v20181114

文档:https://www.eclipse.org/jetty/javadoc/9.4.14.v20181114/index.html?overview-summary.html

1、新建一个maven项目,修改pom文件,

<plugin>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>${jetty.version}</version>
    <configuration>
        <webAppConfig>
            <contextPath>/</contextPath>
        </webAppConfig>
    </configuration>
</plugin>

2、${jetty.version}其实是个变量,在properties定义就可以使用了

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
    <jetty.version>9.4.14.v20181114</jetty.version>
</properties>

3、然后记得以前maven面板,jetty会出现在Plugins,不知道为什么没有了

 

4、但是现在运行 mvn jetty:run 已经可以正常运行了,可以添加一条maven命令

【其它】

1、mvn org.eclipse.jetty:jetty-maven-plugin:run

百度的时候发现还可以这样运行...

2、jetty还有什么配置?

还没找到详细文档,有空补上~

猜你喜欢

转载自blog.csdn.net/qq_39571197/article/details/86214159