How to embed Tomcat server in Maven application
This example is a basic web application to embed Tomcat server in you Maven
application. Basically use of tomcat plug in in your application . Tomcat7 plugin2.2
and higher version can be use for this . Here i have application StartWeb
1. Create Maven Project StartWeb .
2. configure pom.xml.
3. Download Maven setpath and run mvn
5. web.xml file configure
6. create you jsp page or html page
7. clean and install , build the project
8, Start tomcat
9, Run your application .

Pom file will look something like this . This is StartWeb pom.xml.
folder structure
---------------------
you can use java 7 lib if get compilation problem.
pom.xml
-------------
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>StartWeb</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- Servlet Library -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://localhost:8080/manager</url>
<server>localhost</server>
<path>/${project.build.finalName}</path>
</configuration>
</plugin>
</plugins>
</build>
<groupId>StartWeb</groupId>
<name>StartWeb</name>
</project>
So need to configure web.xml . This needed when your create web using jsp , servlets ets
you can use simplest formate also for this application.
web.xml
--------
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<display-name>StartWeb</display-name>
<servlet>
<servlet-name>welcome</servlet-name>
<servlet-class>/welcome.jsp</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>welcome</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>welcome.jsp</welcome-file>
</welcome-file-list>
</web-app>
welcome.jsp
--------------
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title> Startweb</title>
</head>
<body>
<a><b>Welcome User!!!!</b></a>
</body>
</html>
Maven run tomcat
---------------------
Run status
==================
Running application
--------------------------
Shutdown server
-----------------------
For mac simply ctr+c then type command in terminal $ mvn tomcat:shutdown it give build
success.
Or eclipse go ---> run --> run confuguration --> then in goal tomcat:shutdown similarly you can start too.
How to embed Tomcat server in Maven application
Reviewed by Mukesh Jha
on
12:48 AM
Rating:

sinop
ReplyDeletesakarya
gümüşhane
amasya
kilis
K3AR
6975C
ReplyDeleteMEME Coin Hangi Borsada
Karapürçek Boya Ustası
Mardin Evden Eve Nakliyat
Silivri Fayans Ustası
Antalya Lojistik
Hotbit Güvenilir mi
Bilecik Parça Eşya Taşıma
Mefa Coin Hangi Borsada
Burdur Lojistik
4BE73
ReplyDeletesivas rastgele sohbet uygulaması
yozgat ücretsiz sohbet odaları
Sivas Canlı Sohbet Siteleri Ücretsiz
siirt sesli sohbet siteler
ardahan sesli sohbet sitesi
aksaray mobil sohbet siteleri
bursa ücretsiz görüntülü sohbet uygulamaları
kadınlarla sohbet et
çankırı sesli mobil sohbet
668A0
ReplyDeletebinance
bitget
kripto para haram mı
coin nereden alınır
mercatox
probit
güvenilir kripto para siteleri
huobi
kraken
F1E2C
ReplyDeletepoloniex
kraken
binance
bingx
https://kapinagelsin.com.tr/
August 2024 Calendar
2024 Calendar
mobil proxy 4g
paribu
A1094
ReplyDelete----
----
----
----
----
----
----
matadorbet
----
D55D3
ReplyDeletegörüntülü show
C153A
ReplyDeletewhatsapp görüntülü show güvenilir
9C83D02235
ReplyDeletegreen temptation
maxman
stag
fx15
viagra
sildegra
sertleÅŸtirici
ücretli şov
kaldırıcı
C098583F6E
ReplyDeletesildegra
stag
bufalo içecek
cialis
vigrande
canli cam show
canli web cam show
lady era
görüntülü şov
2261CBF68D
ReplyDeletemaxman
skype ÅŸov
cam ÅŸov
lady era
vega
ücretli show
ücretli şov
görüntülü şov
yapay kızlık zarı
761ECC5B03
ReplyDeletecanli web cam show
9918089E50
ReplyDeletetwitter ucuz beğeni satın al
57F4A6210D
ReplyDeletecoin madenciliÄŸi
telegram coin botları güvenilir mi
coin kazandıran oyunlar
yatırımsız coin kazan
telegram coin oyunları
Comprar carta de condução
ReplyDeletethanks for the content,nice blog
4401A1FED7
ReplyDeleteGüvenilir Telegram Farm Botları
Telegram Botları
Telegram Para Kazanma
Airdrop Botları
Telegram Coin Kazanma Botları
91FFE664C4
ReplyDeleteTelegram Güvenilir Coin Oyunları
Telegram Coin Kazandıran Botlar
Telegram Para Kazandıran Botlar
Listelenen Telegram Botları
Telegram Para Kazanma Botları
FAE63BC0DF
ReplyDelete-
-
kuşadası eskort
-
-