Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-57408

MSBuild plugin "Install automatically" function not working

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • msbuild-plugin
    • None

      A description of the problem:
      I have installed the MSBuild plugin (version 1.29). When configuring a MSBuild installation, if I try to configure an installer (using the "Install automatically" option and selecting "Extract .zip/.tar.gz"), the configuration doesn't get saved.

      If I try from the "Global Tool Configuration" UI, after I hit the Save or Apply buttons and navigate away from the page (not just pressing the back button) and return to the Global Tool Configuration page, the Installer configuration for the MSBuild installation is no longer there. Additionally, checking the config file - hudson.plugins.msbuild.MsBuildBuilder.xml - inside Jenkins Master, the configuration doesn't get saved (or updated) at any point. This is how the xml appears:

      <?xml version='1.1' encoding='UTF-8'?>
      <hudson.plugins.msbuild.MsBuildBuilder_-DescriptorImpl plugin="msbuild@1.29">
        <installations>
          <hudson.plugins.msbuild.MsBuildInstallation>
            <name>MSBuild</name>
            <home></home>
            <properties/>
          </hudson.plugins.msbuild.MsBuildInstallation>
        </installations>
      </hudson.plugins.msbuild.MsBuildBuilder_-DescriptorImpl>

       

      Alternatively, I also tried configuring the installer manually by editing the aforementioned xml file with the following configuration:

      <?xml version='1.1' encoding='UTF-8'?><hudson.plugins.msbuild.MsBuildBuilder_-DescriptorImpl plugin="msbuild@1.29">
        <installations>
          <hudson.plugins.msbuild.MsBuildInstallation>
            <name>MSBuild</name>
            <home></home>
            <properties>
              <hudson.tools.InstallSourceProperty>
                <installers>
                  <hudson.tools.ZipExtractionInstaller>
                    <label>windows</label>
                    <url>https://artifactoryurl/path/to/msbuild.zip</url>
                    <subdir>msbuild</subdir>
                  </hudson.tools.ZipExtractionInstaller>
                </installers>
              </hudson.tools.InstallSourceProperty>
            </properties>
          </hudson.plugins.msbuild.MsBuildInstallation>
        </installations>
      </hudson.plugins.msbuild.MsBuildBuilder_-DescriptorImpl>
      

       

      After saving the configuration file and restarting Jenkins, if I navigate to the "Global Tool Configuration" page and view my MSBuild Installation configuration, I am able to see the configurations for the Installer reflected on the page. However, if I navigate away from the page and come back, the Installer configuration disappears from the UI. Additionally, when checking the configuration file, I now see that the configurations that I had added manually is no longer there.

      I should note that I couldn't capture any activity in the logs. However, I repeated the above steps and ran the following command: "$ find . -cmin -1" in the Jenkins HOME directory (where the config files live). I confirmed that no configurations were being written to any other files.

      Additionally, I have tried the same steps above for my JDK installations. The configurations I set for the "Install automatically > "Extract .zip/.tar.gz" option does get saved and works properly.

      Steps to reproduce from UI:

      1. On Jenkins ver.2.164.1, install the MSBuild Plugin (version 1.29)

       

      2. Navigate to Global Tool Configuration Jenkins -> Global Tool Configuration -> MSBuild

      3. In the MSBuild section, click "Add MSBuild" and add a name to the "Name" field

      4. Check the "Install automatically" option

      5. Select "Extract .zip/.tar.gz"

      6. In the Label field add "windows"

      7. In the "Download URL for binary archive" add a proper url containing a zip file of the msbuild.exe

      8. In the "Subdirectory of extracted archive" field add "msbuild"

      9. Click the "Save" or "Apply" button. If you click "Apply", navigate away from the Global Tool Configuration page without using the back button.

      10. Navigate back into the Global Tool Configuration page

      Steps to reproduce from Master box:

      1. SSH into master
      2. cd to the HOME directory for Jenkins (the path for the Environment Variable: HOME)
      3. Edit and save the hudson.plugins.msbuild.MsBuildBuilder.xml with 
        <?xml version='1.1' encoding='UTF-8'?><hudson.plugins.msbuild.MsBuildBuilder_-DescriptorImpl plugin="msbuild@1.29">
         <installations>
           <hudson.plugins.msbuild.MsBuildInstallation>
             <name>MSBuild</name>
             <home></home>
             <properties>
               <hudson.tools.InstallSourceProperty>
                 <installers>
                   <hudson.tools.ZipExtractionInstaller>
                     <label>windows</label>
                     <url>https://artifactoryurl/path/to/msbuild.zip</url>
                     <subdir>msbuild</subdir>
                   </hudson.tools.ZipExtractionInstaller>
                 </installers>
               </hudson.tools.InstallSourceProperty>
             </properties>
           </hudson.plugins.msbuild.MsBuildInstallation>
         </installations>
        </hudson.plugins.msbuild.MsBuildBuilder_-DescriptorImpl>
        
      1. Restart Jenkins
      2. In the UI, navigate to the Global Tool Configuration page
      3. Scroll down to the "MSBuild" section and click "MSBuild Installations..."
      4. The manual configurations should be reflected for the MSBuild installer
      5. Navigate out of "Global Tool Configuration" without pressing the back button
      6. Navigate back into "Global Tool Configuration".
      7. The configuration will no longer be there
      8. In Jenkins master, open the hudson.plugins.msbuild.MsBuildBuilder.xml file. The manual configurations saved earlier will no longer be there.

            marshall777 Lionel Cabasson
            slee Steven Lee
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: