部署Jenkins遇到的坑和解决方案

1. Finished: FAILURE
一般在Windows下安装Jenkins,默认workspace目录,在c盘xxx下,之间是有空格的,后期用cmd命令行执行命令会报错
这时候就需要将目录的路径移动一下
如何?
设置电脑的环境变量,JEKNINS_HOME = 比如我为D盘下的新建文件夹,命令Jenkinds
然后到安装目录下查找Jenkins.xml文件,将其中的JENKINS_HOME由BASE改为%JENKINS_HOME%
将原先Base下的目录全部copy到D盘新建目录下
之后重新打开即可

2.Jenkins 的根 URL 为空,但对于 Jenkins 的很多特色是必需的,例如:邮件通知, PR 状态更新,以及像 BUILD_URL 一样的环境变量。

请在 Jenkins 配置 提供一个准确的值。

3. 手残误删了Jenkins运行的java进程,结果。。。。

 用管理员身份启动cmd

然后进入jenkins目录。运行 net start jenkins

否则会报系统错误5

 

延伸: net stop jenkins

 

4. 如何安装maven插件

进入系统管理 ----  插件管理  ----  用页面自带的搜索安装Maven Integration

 

5. 本地全局工具的配置

使用本地jdk

使用本地maven

只要到本地maven的解压目录即可,我这边新建了一个目录maven

 

使用本地git

 

 

 

 

 6. 不显示中文

这边分两种,一种是Jenkins就没有中文插件,第二种是别人的浏览器打开是中文,而你的是英语

第一种的解决办法,就是下载中文插件,我这边在安装的时候自行下载的一个local啥的

第二种,和自己的浏览器设置有关,比如我之前的浏览器,优先的语言是英文,修改优先的语言为中文即可

 

7. 更改对应的端口

网上很多教程的更改方式是执行的时候用java -jar jenkins.war  --httpPort=8081

windows用msi安装的,启动的时候并没有用jave -jar,就需要去Jenkins安装目录下找到xml文件,然后更改其中的port,在重启一下

<!--
  Windows service definition for Jenkins.

  To uninstall, run "jenkins.exe stop" to stop the service, then "jenkins.exe uninstall" to uninstall the service.
  Both commands don't produce any output if the execution is successful. 
-->
<service>
  <id>Jenkins</id>
  <name>Jenkins</name>
  <description>This service runs Jenkins automation server.</description>
  <env name="JENKINS_HOME" value="%BASE%"/>
  <!--
    if you'd like to run Jenkins with a specific version of Java, specify a full path to java.exe.
    The following value assumes that you have java in your PATH.
  -->
  <executable>%BASE%\jre\bin\java</executable>
  <arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=5118 --webroot="%BASE%\war"</arguments>
  <!--
    interactive flag causes the empty black Java window to be displayed.
    I'm still debugging this.
  <interactive />
  -->
  <logmode>rotate</logmode>

  <onfailure action="restart" />
  
  <!-- 
    In the case WinSW gets terminated and leaks the process, we want to abort
    these runaway JAR processes on startup to prevent corruption of JENKINS_HOME.
    So this extension is enabled by default.
  -->
  <extensions>
    <!-- This is a sample configuration for the RunawayProcessKiller extension. -->
    <extension enabled="true" 
               className="winsw.Plugins.RunawayProcessKiller.RunawayProcessKillerExtension"
               id="killOnStartup">
      <pidfile>%BASE%\jenkins.pid</pidfile>
      <stopTimeout>10000</stopTimeout>
      <stopParentFirst>false</stopParentFirst>
    </extension>
  </extensions>
  
  <!-- See the referenced examples for more options -->
  
</service>

  

转载于:https://www.cnblogs.com/qianjinyan/p/10769929.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值