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) run 或debug啟動項目,即可

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM