简体   繁体   English

Jenkins Linux主服务器和Windows从属服务器:Maven构建配置

[英]Jenkins Linux master and Windows slave: Maven builds configuration

I have a Linux Jenkins master in our network configured for Maven builds. 我的网络中为Maven构建配置了Linux Jenkins主服务器。 To improve performance I decided to configure the Jenkins slave on a Windows machine (I don't currently have another Linux server for it). 为了提高性能,我决定在Windows机器上配置Jenkins从站(我目前没有其他Linux服务器)。 I have successfully added the Windows-based slave, but several questions stays unclear for me: 我已经成功添加了基于Windows的从属服务器,但是对我来说几个问题仍然不清楚:

  1. Does Windows slave machine need its own Maven instance? Windows从属计算机是否需要其自己的Maven实例? If yes, how do I set it in the slave configuration? 如果是,如何在从站配置中进行设置?

  2. Can I configure my builds to be able to run on both Linux master and Windows slave? 我可以将我的构建配置为能够在Linux主服务器和Windows从服务器上运行吗?

    For example, the project configuration contains a Build section with " Goals and Options : clean install -s /opt/hudson_home/m2-settings-bwa.xml -P -abgabe ". 例如,项目配置包含一个“ 目标和选项clean install -s /opt/hudson_home/m2-settings-bwa.xml -P -abgabe ”的“ clean install -s /opt/hudson_home/m2-settings-bwa.xml -P -abgabe ”部分。 Unfortunately the path to the XML file is not valid in Windows. 不幸的是,XML文件的路径在Windows中无效。 How should I configure both Linux and Windows environments (and projects) then? 那我该如何配置Linux和Windows环境(以及项目)呢?

  1. By maven instance do you mean maven installation? 所谓的Maven实例,是指安装Maven? If so - no. 如果是这样-不。 Jenkins will copy over the maven jars it needs dynamically to the slave. Jenkins会将其所需的Maven jar动态复制到slave。

  2. You may be able to find workarounds for the scenario you described (perhaps copying the file to the workspace using copy-to-slave plugin), but it is worth asking yourself if you really want the same job producing both Windows-built and Lunix-built software. 您也许可以找到所描述方案的解决方法(也许使用“复制到从属”插件将文件复制到工作区),但是值得问一问自己,您是否真的想同时生产Windows内置和Lunix-内置软件。 Yes, Java code should run anywhere, but there are exceptions... 是的,Java代码应该在任何地方运行,但是也有例外...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM