Jenkins:从SVN拉取Maven项目,部署Tomcat(Deploy to container)

简介: Jenkins:从SVN拉取Maven项目,部署Tomcat(Deploy to container)

Jenkins相关文章

1.Jenkins安装(Linux版)

2.Jenkins:从SVN拉取Maven项目


1.Jenkins安装相关插件

Deploy to container ## 件将应用发布到tomcat下

2.Tomcat管理用户配置

  • 在TOMCAT_HOME/conf/tomcat-users.xml添加manager-script组和相应的用户
<?xml version='1.0' encoding='utf-8'?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at
      http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<tomcat-users xmlns="http://tomcat.apache.org/xml"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
              version="1.0">
<!--
  NOTE:  By default, no user is included in the "manager-gui" role required
  to operate the "/manager/html" web application.  If you wish to use this app,
  you must define such a user - the username and password are arbitrary. It is
  strongly recommended that you do NOT use one of the users in the commented out
  section below since they are intended for use with the examples web
  application.
-->
<!--
  NOTE:  The sample user and role entries below are intended for use with the
  examples web application. They are wrapped in a comment and thus are ignored
  when reading this file. If you wish to configure these users for use with the
  examples web application, do not forget to remove the <!.. ..> that surrounds
  them. You will also need to set the passwords to something appropriate.
-->
<!--
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
  <user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
  <user username="role1" password="<must-be-changed>" roles="role1"/>
-->
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="tomcat" password="tomcat" roles="manager-gui,manager-script,manager-jmx,manager-status"/>
<user username="deploy" password="deploy123456" roles="manager-script"/>
</tomcat-users>


3.Jenkins配置-构建后操作

  • 在配置中,选择“构建后操作”
  • 在“构建后操作”中选择“Deploy war/ear to container”
  • 参数说明
WAR/EAR files:是war包的相对路径
Content path:项目名称。tomcat的发布路径,即使用IP:端口号/(Content path设置的名字)来访问项目
Containers--
选择Tomcat的版本号,
Credendials,点击Add,输入tomcat-users.xml中用户名和密码,
Tomcat URL,填写tomcat所在的IP和端口号

图片.png

图片.png

  • 点击保存,查看控制台输出

图片.png

4.Jenkins部署注意

  • 部署前要先启动运程机上的WEB容器,插件需要通过容器提供的接口将war包发布到容器下

5.Jenkins部署异常



目录
相关文章
|
2月前
|
监控 Java 应用服务中间件
部署tomcat部署实战案例
本文是关于Tomcat部署实战案例的教程,包括通过yum和二进制方式部署Tomcat的详细步骤,以及如何监控Tomcat服务。
190 84
部署tomcat部署实战案例
|
3月前
|
Java 应用服务中间件 Windows
【应用服务 App Service】App Service 中部署Java项目,查看Tomcat配置及上传自定义版本
【应用服务 App Service】App Service 中部署Java项目,查看Tomcat配置及上传自定义版本
|
2月前
|
应用服务中间件 Docker 容器
docker应用部署---Tomcat的部署配置
这篇文章介绍了如何使用Docker部署Tomcat服务器,包括搜索和拉取Tomcat镜像、创建容器并设置端口映射和目录映射,以及如何创建一个HTML页面并使用外部机器访问Tomcat服务器。
docker应用部署---Tomcat的部署配置
|
25天前
|
Java 应用服务中间件 Maven
idea+maven+tomcat+spring 创建一个jsp项目
这篇文章介绍了如何在IntelliJ IDEA中使用Maven和Tomcat创建一个JSP项目,包括配置Maven依赖、设置Tomcat服务器、编写JSP页面、创建控制器和配置文件,以及项目的运行结果。
106 0
idea+maven+tomcat+spring 创建一个jsp项目
|
17天前
|
Java 应用服务中间件 Linux
tomcat学习二:tomcat部署多个项目:不修改端口和修改端口 两种方式详解
这篇文章详细介绍了在Tomcat服务器上部署多个项目的方法,包括不修改端口和修改端口两种方式。
59 0
|
2月前
|
前端开发 Java 应用服务中间件
react自学(6) 部署到tomcat中
react自学(6) 部署到tomcat中
|
XML 应用服务中间件 数据格式
|
24天前
|
安全 应用服务中间件 网络安全
Tomcat如何配置PFX证书?
【10月更文挑战第2天】Tomcat如何配置PFX证书?
118 7
|
24天前
|
存储 算法 应用服务中间件
Tomcat如何配置JKS证书?
【10月更文挑战第2天】Tomcat如何配置JKS证书?
184 4
|
3月前
|
网络协议 Java 应用服务中间件
tomcat配置域名及HTTPS
tomcat配置域名及HTTPS