简体   繁体   中英

Jenkins Linux master and Windows slave: Maven builds configuration

I have a Linux Jenkins master in our network configured for Maven builds. To improve performance I decided to configure the Jenkins slave on a Windows machine (I don't currently have another Linux server for it). I have successfully added the Windows-based slave, but several questions stays unclear for me:

  1. Does Windows slave machine need its own Maven instance? 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?

    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 ". Unfortunately the path to the XML file is not valid in Windows. How should I configure both Linux and Windows environments (and projects) then?

  1. By maven instance do you mean maven installation? If so - no. Jenkins will copy over the maven jars it needs dynamically to the 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. Yes, Java code should run anywhere, but there are exceptions...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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