IDEA中使用中jetty启动java项目(非springboot)


1.安装maven helper插件,略

2.项目pom.xml文件中添加jetty插件配置

<build>
        <plugins>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.4.12.v20180830</version>
                <configuration>
                    <httpConnector>              <!--指定端口号-->
                        <port>8080</port>
                        <idleTimeout>10000</idleTimeout>
                    </httpConnector>
                    <webApp>
                        <contextPath>/${project.artifactId}</contextPath>
                    </webApp>
                </configuration>
            </plugin>
        </plugins>
    </build>

3.run-->edit configurations,新增maven

 

 

a)在working directory 内,选择项目路径

b)在command line内,输入jetty:run

 

 

 c) 取消test

 

 

 d) run 或debug启动项目,即可

 

 

 

参考文档:https://www.cnblogs.com/lixyu/p/10001894.html


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM