Jenkins : Hudson won't install plugins because hudson.dev.java.net isn't allowed

If you've upgraded from a version of Hudson earlier than 1.330, you may encounter an error like the one below when attempting to install or upgrade plugins:

Oct 28, 2009 2:14:58 PM hudson.model.UpdateCenter$DownloadJob run
INFO: Starting the installation of Mercurial Plugin on behalf of bshows
Oct 28, 2009 2:14:58 PM hudson.model.UpdateCenter$DownloadJob run
SEVERE: Failed to install Mercurial Plugin
java.io.IOException: Installation of plugin from
https://hudson.dev.java.net/files/documents/2402/144520/mercurial.hpi is not allowed
       at hudson.model.UpdateCenter$UpdateCenterConfiguration.preValidate(UpdateCenter.java:583)
       at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:846)
       at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:951)
       at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:832)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
       at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
       at java.util.concurrent.FutureTask.run(FutureTask.java:138)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
       at java.lang.Thread.run(Thread.java:619)

This is a result of the data file Hudson gets its information on available plugins, versions, etc, and the plugin and core Hudson downloads themselves, have moved to a new server, and older versions of the file in question, update-center.json, won't work with Hudson 1.330 and later.

To fix this, do the following:

  • Stop Hudson.
  • Delete $HUDSON_HOME/update-center.json.
  • Restart Hudson.
  • Go to Manage Hudson->Manage Plugins, and then the Advanced tab - click "Check Now" in the bottom right.

After doing this, you'll have an up-to-date copy of update-center.json, and you'll be able to install or upgrade plugins as before.