Tomcat - Maven plugin: 運行找不到webapp

2019獨角獸企業重金招聘Python工程師標準>>> hot3.png

The?tomcat7-maven-plugin?allows running the current project as a Web application and additional?<webapps>?can be specified that will be simultaneously loaded into tomcat.

My project is not a Web application, but it accesses services that are provided by webapps. So how is it possible to deploy a number of webapps without running the project itself as a webapp? The following Maven snippet results in FileNotFoundExceptions because a context.xml cannot be found.

<plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin</artifactId><version>2.0</version><executions><execution><id>run-tomcat</id><phase>${tomcat.run.phase}</phase><goals><goal>run-war-only</goal></goals><configuration><webapps><webapp><contextPath>/my/app1</contextPath><groupId>...</groupId> <artifactId>...</artifactId><version>...</version><type>war</type>    <asWebapp>true</asWebapp></webapp>... possibly more webapps ...</webapps> </configuration></execution><execution><id>tomcat-shutdown</id><phase>${tomcat.shutdown.phase}</phase><goals><goal>shutdown</goal></goals></execution></executions>
</plugin>

Workaround:

Even though your application itself is not a webapp, you need to configure a?path?and a?contextFile?for it:

<configuration><path>/my/non/existing/webapp</path><contextFile>src/test/resources/context.xml</contextFile><webapps>...

The specified?context.xml?file must exist. The following worked for me, even though the?web.xmlfile does not exist:

<?xml version="1.0" encoding="utf-8"?>
<Context path="/my/non/existing/webapp"><WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>

轉載于:https://my.oschina.net/u/2308739/blog/673555

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/458563.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/458563.shtml
英文地址,請注明出處:http://en.pswp.cn/news/458563.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

面試題3

1. 你如何理解 iOS 內存管理 1. new alloc copy retain這些對象我們都要主動的release或者 autorelease 2. 如果是類方法創建的對象,那么系統自動釋放池自動在適當的 時候會幫我們 release 3. ARC xcode 自動會幫我們人工智能的添加 release autorelease 操 作 2. C語言里的數…

基于MQTT協議進行應用開發

來自&#xff1a;http://www.cnblogs.com/secondtononewe/p/6073089.html 官方協議有句如下的話來形容MQTT的設計思想&#xff1a; “It is designed for connections with remote locations where a "small code footprint" is required or the network bandwidth i…

SortedDictionaryTKey,TValue正序與反序排序及Dicttionary相關

SortedDictionary<TKey,TValue>能對字典排序 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;namespace SortDictionary {class Program{static void Main(string[] args){TestDictionarySort();…

DOS窗口的編碼頁從UTF-8調回GBK

2019獨角獸企業重金招聘Python工程師標準>>> 之前在DOS窗口操作MySQL數據庫的時候&#xff0c;將編碼頁從GBK設置成了UTF-8&#xff0c;解決了在DOS窗口顯示MySQL數據庫中的表中的中文字符出現亂碼的問題。但是除此之外&#xff0c;DOS窗口顯示的其他中文字符都是亂…

UIBezierPath

學習UIBezierPath畫圖 筆者在寫本篇文章之前&#xff0c;也沒有系統學習過貝塞爾曲線&#xff0c;只是曾經某一次的需求需要使用到&#xff0c;才臨時百度看了一看而且使用最基本的功能。現在總算有時間停下來好好研究研究這個神奇而偉大的貝塞爾先生&#xff01; 筆者在學習時…

系統架構設計理論與原則

一、無共享架構 1、無共享架構 無共享架構是一種分布式計算架構&#xff0c;這種架構中不存在集中存儲的狀態&#xff0c;系統中每個節點都是獨立自治的&#xff0c;整個系統中沒有資源競爭&#xff0c;這種架構具有非常強的擴張性&#xff0c;目前在web應用中被廣泛使用。 無共…

VS2010 教程:創建一個 WPF 應用程序 (第一節)

來自&#xff1a;https://msdn.microsoft.com/zh-cn/library/ff629048.aspx [原文發表地址] VS2010 Tutorial: Build a WPF App (Step 1) [原文發表時間] Friday, May 22, 2009 8:00 AM 這篇文章里&#xff0c;我將使用VS2010 Beta 1創建一個WPF 應用程序。并且 我將展示這個產…

js 日期星期 帶農歷

Weekday代碼 //得到當前日期如2009年6月19日 星期五 function getDate(){ var today new Date(); var x new Array("星期日", "星期一", "星期二","星期三","星期四", "星期五","星期六"…

FMDB的使用

// // FMDBmanager.h // database // // Created by PRL on 16/10/13. // Copyright © 2016年PRL. All rights reserved. // #import <Foundation/Foundation.h> interface FMDBmanager : NSObject{ FMDatabase * _db; } (FMDBmanager *)sharedManager; //獲取…

深入淺出WPF之Binding的使用(一)

from: http://www.cnblogs.com/akwwl/p/3421005.html 在WPF中Binding可以比作數據的橋梁&#xff0c;橋梁的兩端分別是Binding的源&#xff08;Source&#xff09;和目標&#xff08;Target&#xff09;。 一般情況下&#xff0c;Binding源是邏輯層對象&#xff0c;Binding目…

arm處理器中a5 a8 a9,v6 v7,arm7 arm9 arm11都是依據什么來分類的【轉】

轉自&#xff1a;http://blog.csdn.net/maochengtao/article/details/9951131ARM處理器發展這么多年&#xff0c;有很多架構&#xff0c;很多不同的內核 架構有armv1 v2 v3 v4 v5 v6 v7 內核太多了&#xff0c;比如armv1對應的是arm1&#xff0c;armv5對應的arm9&#xff0c;ar…

前端開發一些很有用的工具

apiview.com 接口規范管理平臺 restClient 谷歌瀏覽器接口測試工具 postman 接口測試工具 SSH Secure Shell Client 抓包工具 SSH SecureFile Transfer Client wireshark 抓包分析工具 Xshell linux遠程工具 Balsamiq Mockups 原型圖 visio 流程圖 xmind top圖 SourceCounter、…

所有的iPhone設備cell的寬度都是320,解決辦法是?

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { self.frameCGRectMake(0, 0, SW, 44); } return self; } 自己重設一下寬度就行了

深入淺出WPF之Binding的使用(二)

from: http://www.cnblogs.com/akwwl/p/3421250.html 在上一篇中介紹了Binding的基本綁定方法&#xff0c;這一篇中我們在深入的介紹Binding的其他用法。 Binding的源也就是數據的源頭&#xff0c;在日常的工作中&#xff0c;除了使用像上一篇中的Student對象作為數據源外&a…

iOS 推送

最近在研究ios的推送問題&#xff0c;遇到了一些問題&#xff0c;最終整理了一下。放在這里和大家分享APNS的推送機制首先我們看一下蘋果官方給出的對ios推送機制的解釋。如下圖 Provider就是我們自己程序的后臺服務器&#xff0c;APNS是Apple Push Notification Service的縮寫…

Bash判斷文件夾(目錄)是否存在

1 #!/bin/bash 2 if [ -d DirName ]; then 3 echo Dir exist 4 else 5 echo Dir not exist 6 fi 轉載于:https://www.cnblogs.com/imzye/p/5059031.html

iOS 加載本地html文件詳細操作

webView的加載&#xff0c;如果是純文本&#xff0c;有內部樣式的話&#xff0c;簡單的加載請求就可以了。如下: 這種加載簡單直接&#xff0c;易操作。 如果需要加載images&#xff0c;css文件 需要把xcode的項目請求路徑的位置告訴webView.代碼如下&#xff1a; 這樣html文件…

HDU 5573 Binary Tree 構造

Binary Tree題目連接&#xff1a; http://acm.hdu.edu.cn/showproblem.php?pid5573 Description The Old Frog King lives on the root of an infinite tree. According to the law, each node should connect to exactly two nodes on the next level, forming a full binary…

志邦櫥柜坑爹,志邦櫥柜大忽悠,志邦櫥柜欺騙

本人實實在在經歷的&#xff0c;志邦櫥柜就是個大忽悠,志邦櫥柜沒誠信!! 志邦櫥柜先騙客戶下訂單,在預算時低開,到真正簽合同時&#xff0c;不僅僅尺寸坑你,一大堆增項都會出來,原本1.5w預算到最后簽合同總價到2.2w,簽合同增項高開最后志邦櫥柜總價超預算非常非常離譜&#xff…

多線程的那點兒事(之讀寫鎖)

在編寫多線程的時候&#xff0c;有一種情況是十分常見的。那就是&#xff0c;有些公共數據修改的機會比較少。相比較改寫&#xff0c;它們讀的機會反而高的多。通常而言&#xff0c;在讀的過程中&#xff0c;往往伴隨著查找的操作&#xff0c;中間耗時很長。給這種代碼段加鎖&a…