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月前
|
运维 jenkins Java
Jenkins 自动化局域网管控软件构建与部署流程
在企业局域网管理中,Jenkins 作为自动化工具,通过配置源码管理、构建及部署步骤,实现了高效、稳定的软件开发与部署流程,显著提升局域网管控软件的开发与运维效率。
66 5
|
4月前
|
Java Shell 应用服务中间件
Mac系统下配置环境变量:Javajdk、maven、tomcat 环境变量配置及对应配置文件
这篇文章介绍了如何在Mac系统下配置Java JDK、Maven和Tomcat的环境变量,包括配置文件的选择、解决环境变量在zsh shell中无效的问题、查看和设置系统环境变量的方法,以及JDK和Maven的下载、配置和测试步骤。
1833 1
Mac系统下配置环境变量:Javajdk、maven、tomcat 环境变量配置及对应配置文件
|
4月前
|
自然语言处理 jenkins 测试技术
Jenkins适合什么样的项目
【10月更文挑战第18天】Jenkins适合什么样的项目
52 3
|
4月前
|
jenkins Shell 持续交付
Jenkins持续集成GitLab项目 GitLab提交分支后触发Jenkis任务 持续集成 CI/CD 超级详细 超多图(二)
Jenkins持续集成GitLab项目 GitLab提交分支后触发Jenkis任务 持续集成 CI/CD 超级详细 超多图(二)
125 0
|
4月前
|
jenkins Java 持续交付
Jenkins打包,发布,部署
Jenkins打包,发布,部署
324 0
|
4月前
|
jenkins Shell 持续交付
Jenkins持续集成GitLab项目 GitLab提交分支后触发Jenkis任务 持续集成 CI/CD 超级详细 超多图(一)
Jenkins持续集成GitLab项目 GitLab提交分支后触发Jenkis任务 持续集成 CI/CD 超级详细 超多图(一)
324 0
|
6月前
|
Kubernetes jenkins 持续交付
jenkins学习笔记之二十一:k8s部署jenkins及动态slave
jenkins学习笔记之二十一:k8s部署jenkins及动态slave
|
6月前
|
负载均衡 jenkins 应用服务中间件
大规模部署下的 Jenkins 高可用性与负载均衡
【8月更文第31天】随着软件开发流程的加速,持续集成/持续交付(CI/CD)工具的重要性日益凸显。Jenkins 作为最受欢迎的 CI/CD 平台之一,为企业提供了强大的自动化构建和部署功能。然而,在大规模部署场景下,单一的 Jenkins 实例可能无法满足高可用性和性能的需求。本文将探讨如何设计和实施 Jenkins 高可用集群,以支持大型组织的需求,并通过负载均衡技术来提高系统的稳定性和响应速度。
444 0
|
6月前
|
jenkins 测试技术 持续交付
Jenkins 在多分支项目中的应用
【8月更文第31天】在现代软件开发实践中,分支管理是一项至关重要的策略,它允许开发团队在不同的功能开发、修复bug或进行实验时不会干扰主干代码。随着项目的复杂度增加,维护多个分支并确保它们的质量变得越来越具有挑战性。Jenkins 作为一款流行的持续集成(CI)和持续部署(CD)工具,提供了强大的功能来支持多分支项目的自动化测试和部署。本文将探讨 Jenkins 如何帮助管理多分支项目,并提供具体的代码示例。
169 0
|
6月前
|
jenkins Java Shell
jenkins学习笔记之十三:配置SonarScanner扫描Java项目
jenkins学习笔记之十三:配置SonarScanner扫描Java项目

推荐镜像

更多