IDEA的run maven方式啟動步驟詳解
安裝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(注意這里的端口號,被占用了就換一個(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。修改了對應(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方式啟動步驟詳解的文章就介紹到這了,更多相關(guān)IDEA的run maven方式啟動內(nèi)容請搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!
相關(guān)文章:
1. ASP.NET MVC使用正則表達(dá)式驗(yàn)證手機(jī)號碼2. ASP.NET MVC把數(shù)據(jù)庫中枚舉項(xiàng)的數(shù)字轉(zhuǎn)換成文字3. SpringMVC+Jquery實(shí)現(xiàn)Ajax功能4. 基于javaweb+jsp實(shí)現(xiàn)企業(yè)財(cái)務(wù)記賬管理系統(tǒng)5. .Net Core 配置文件讀取IOptions,IOptionsMonitor,IOptionsSnapshot6. ASP新手必備的基礎(chǔ)知識7. Python數(shù)據(jù)庫格式化輸出文檔的思路與方法8. python中%格式表達(dá)式實(shí)例用法9. XML基本概念XPath、XSLT與XQuery函數(shù)介紹10. Python接口測試get請求過程詳解
