IDEA的run maven方式啟動(dòng)步驟詳解
安裝jetty插件
1. 找到Plugins,查找jetty插件,安裝“IDEA Jetty Runner”,安裝好后重啟IDEA
安裝插件:Maven Helper
方法同Jetty
pom.xml添加
<plugins> <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.4.15.v20190215</version> </plugin> </plugins>
配置maven:jetty:run -Djetty.port=8088
1. Run-->Edit Configurations
2. jetty:run -Djetty.port=8088(注意這里的端口號(hào),被占用了就換一個(gè))
執(zhí)行
項(xiàng)目右鍵-->run maven-->clean install
然后再執(zhí)行:項(xiàng)目右鍵-->run maven-->test03bulid
新建jsp文件
新建index.jsp文件,是顯示頁面,可以直接復(fù)制原有的index.jsp文件
網(wǎng)址
http://localhost:8088/user/test?id=1
遇到問題
問題1:plugins里添加的插件不顯示
不要寫到這個(gè)標(biāo)簽里面的plugins里:
<pluginManagement> <pluginManagement> <plugins> ... </plugins> </pluginManagement> <plugins> 寫到這里 </plugins>
問題2:頁面報(bào)錯(cuò)500:PWC6033: Unable to compile class for JSP
用的JDK版本是JDK9。修改了對(duì)應(yīng)的jetty版本
改之后:
<plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.4.15.v20190215</version> </plugin>
改之前:
<plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>7.1.6.v20100715</version> <configuration> <stopPort>9088</stopPort> <stopKey>foo</stopKey> <scanIntervalSeconds>5</scanIntervalSeconds> <connectors> <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> <port>8081</port> <maxIdleTime>60000</maxIdleTime> </connector> </connectors> <webAppConfig> <contextPath>/</contextPath> </webAppConfig> </configuration> </plugin>
問題3:頁面錯(cuò)誤404
查看網(wǎng)址,在網(wǎng)址指定位置(jsp/index.jsp)新建了一個(gè)index.jsp文件
到此這篇關(guān)于IDEA的run maven方式啟動(dòng)步驟詳解的文章就介紹到這了,更多相關(guān)IDEA的run maven方式啟動(dòng)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
通過JDBC連接oracle數(shù)據(jù)庫的十大技巧
通過JDBC連接oracle數(shù)據(jù)庫的十大技巧...2006-12-12Spring?MVC中@Controller和@RequestMapping注解使用
這篇文章主要介紹了Spring?MVC中@Controller和@RequestMapping注解使用,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-02-02java并發(fā)編程專題(六)----淺析(JUC)Semaphore
這篇文章主要介紹了java JUC)Semaphore的相關(guān)資料,文中示例代碼非常詳細(xì),供大家參考和學(xué)習(xí),感興趣的朋友可以了解下2020-07-07SpringBoot 多任務(wù)并行+線程池處理的實(shí)現(xiàn)
這篇文章主要介紹了SpringBoot 多任務(wù)并行+線程池處理的實(shí)現(xiàn),小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2018-04-04