1. 程式人生 > >MVN JETTY:RUN 報錯 The plugin 'org.mortbay.jetty:maven-jetty-plugin' does not exis

MVN JETTY:RUN 報錯 The plugin 'org.mortbay.jetty:maven-jetty-plugin' does not exis

使用jetty-maven-plugin外掛進行測試


為了能夠使用maven的jetty外掛對專案進行測試,需要進行如下操作:

(1)修改maven配置檔案

為了能夠在命令列中使用jetty命令,需要修改maven的配置檔案settings.xml檔案,新增如下配置程式碼:

  1. <pluginGroup>org.mortbay.jetty</pluginGroup>

(2)修改專案的pom.xml檔案
  1. <plugin>
  2.             <groupId>org.mortbay.jetty</groupId>
  3.             <
    artifactId>jetty-maven-plugin</artifactId>
  4.             <version>7.6.10.v20130312</version>
  5.             <configuration>
  6.                 <scanIntervalSecond>10</scanIntervalSecond>
  7.                 <webApp>
  8.                     <contextPath>/test</contextPath>
  9.                 </
    webApp>
  10.                 <connectors>
  11.                     <connectorimplementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
  12.                         <port>8787</port>
  13.                         <maxIdleTime>60000</maxIdleTime>
  14.                     </connector>
  15.                 </connectors>
  16.             </configuration>
  17.         </plugin>
其中scanIntervalSecond表示掃描專案變更的時間間隔,預設為0,表示不掃描。

port表示繫結的埠號,預設監聽的埠是8080

(3)命令列啟動jetty

開啟命令提示符,輸入如下:

  1. mvn jetty:run  
經過一些列的資訊輸出,最終見如下圖:


另外,可以通過命令列繫結埠號啟動,命令如下:

  1. mvn jetty:run -Djetty.port=9999   //繫結的埠號為9999  
通過ctrl + C 就可停止jetty

(4)訪問瀏覽器

開啟瀏覽器,輸入http://localhost:8787/test/hello.jsp,如下圖所示:

上述步驟完成了jetty的基本配置。

相關推薦

MVN JETTY:RUN The plugin 'org.mortbay.jetty:maven-jetty-plugin' does not exis

使用jetty-maven-plugin外掛進行測試 為了能夠使用maven的jetty外掛對專案進行測試,需要進行如下操作: (1)修改maven配置檔案 為了能夠在命令列中使用jetty命令,需要修改maven的配置檔案settings.xml檔案,新增如下配置

SpringBoot專案the import org.springframework.web.*cannot be resolved..

可能原因是沒有在pom.xml中新增web依賴 新增: <dependency>             <groupId>org.springframewo

如何解決JSP頁面頂端 The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

題目有點長,昨天剛接觸jsp,按照網上的教程安裝完 tomcat 和 eclipse EE 之後,新建jsp檔案卻出現瞭如下報錯: The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 教程

SSMCaused by: org.apache.ibatis.binding.BindingException: Parameter 'id' not found

Mapper.java中 public interface OrderInfoMapper {List<OrderInfo> getByUser( Long id);List<OrderInfo> getByUserState(Long id,Int

:The prefix "context" for element "context:annotation-config" is not bound.

spring啟用註解掃描機制:加上<context:annotation-config />這句話報: 1.The prefix "context" for element "context:annotation-config" is not bound. 看看

FeignCaused by: com.netflix.client.ClientException: Load balancer does not have available server for client

nal exceptio ron source start ribbon AC server cer 問題描述 使用Feign調用微服務接口報錯,如下: java.lang.RuntimeException: com.netflix.client.ClientExcepti

mybatis萬用字元引用的問題XML fragments parsed from previous mappers does not contain value

寫mapper A的時候,發現內容太長,於是把被引用的refid單獨抽出來成為一個新的mapper檔案,A中只保留了直接對外的介面申請了,於是就有了mapper B 檔案。 在A檔案裡面引用B的sql,如:     <include refid="B.where_1"

tomcat啟動:The class hierarchy being processed was [org.jaxen.util.AncestorAxisIterator->org.jaxen.u

Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ITSM

MySQL 8.0.12 The table does not comply with the requirements by an external plugin. (errno 3098)

報錯資訊: panic: The table does not comply with the requirements by an external plugin. (errno 3098) (sql

NetBeans IDE驅動The path to the driver executable must be set by the web driver.chrome.driver.system property......

system32 分享 pat appdata .... log google drive exe 問題:defaulstUserDataPath=C:\\Users\\user1\\AppData\\Local\\Google\\Chrome\\User Data\\De

eclipse啟動the catalog could not be loaded please ensure that you have network access and if needed have configured your network proxy

實例 等待 ces .cn access 分享圖片 clas 安裝包 nan 搜索關鍵詞不對在網上查了一圈沒找到合適的解決辦法 去看報錯的日誌文件 然並卵。不過下面有個config.ini,想著以前能用現在不能用,肯定是配置問題,打開該文件 轉載請註明出處http

Ajax使用formdata異步上傳文件,the request was rejected because no multipart boundary was found

mgr The 使用 for ... 導致 文件 字符串 pos 基於jQuery的Ajaxs使用FormData上傳文件要註意兩個參數的設定 processData設為false 把processData設為false,讓jquery不要對formData做處理,如果pr

mvn打包及分析

per AC 添加 jre 普通 vid aps jdk安裝 rop 普通打包命令:   mvn clean install -Dmaven.test.skip=true指定配置文件打包:   mvn clean package -P prod -Dmaven.test.s

docker run ——WARNING: IPv4 forwarding is disabled. Networking will not work.

not work back CA AD warn local In ash 情況 執行 docker run 時遇到如下WARNING: [root@etcd1 volumes]# docker run -d -p 8080:80 -v /tmp/test_mount

Xcode The document “xxx.h” could not be saved. The file doesn’t exist.

文件的 ren xcode ould 退出 文件夾 問題 lean 內部 記錄一個問題 場景:Xcode編輯一個工程時直接在工程內部修改了某個目錄的文件夾名字,而後刪除了其下的某 .h.m 文件 之後總是提示上述錯誤且無法強制退出Xcode,clean等操作基本沒用 查找本

[IDE - Eclipse] JSP:The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path

引入 ips eclips size eclipse -i let details javax 是因為Eclipse的Web項目不自動引入相關jar包. Right Click on the Project ? Properties ? Project Facets. Yo

maven web項目的web.xmlThe markup in the document following the root element must be well-formed.

utf-8 style sta 元素 nbsp 地形 很好 ati instance maven項目裏面的web.xml開頭約束是這樣的 <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi=

JSPThe value for the useBean class attribute *** is invalid.

再次 attribute use 基本 sdn 正常 沒有 class art 環境:IDEA+Tomcat9+JDK1.8 在前期學習時,環境一直能夠“正常”使用,實際上環境並沒有完全搭建成功。 推薦: https://blog.csdn.net/lw_power/art

npm dev run

stp listen load startup emit tor function ESS expr 解決辦法: npm run dev --port 8088 Error: listen EACCES 0.0.0.0:8080at Object.exports._errn

c#使用Npoi 提示 Excel匯出 The maximum number of cell styles was exceeded. You can define up to 4000

在使用NPOI 匯出EXCEL的時候 提示 The maximum number of cell styles was exceeded. You can define up to 4000 styles in a .xls workbook 出現此問題 原因如下: private stat