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.mzph.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…