Caused by: java.net.MalformedURLException
Students have occasionally reported builds failing when the Maven Repository Server plugin is enabled for the project by checking the setting "Define Upstream Maven Repository" within the Build Environment configuration section.
The below exception shows up in the Console Output of the next failed build (after enabling the above setting).
Exception:
After walking through the same steps in a recent Jenkins build using latest version of the plugin and a recent version of Maven, I was able to reproduce the same error reported in the course while using the Maven Repository Server plugin.
I initially thought the problem was the use of the plugin may need settings.xml changes recommended by the plugin's documentation. However, this still failed.
After a bit of research, I found this open Jenkins Issue that hasn't been addressed in over a year. Additionally, looking at the plugin's page, I noticed no development activity with the plugin in over a year as well. If the plugin is fairly stable and works with the latest versions of the Jenkins core, I don't worry about it very much -- but, a plugin with many open critical bugs without recent development activity does concern me.
The main reason I included the plugin in the course is because it solved a missing link in the CI story for Maven projects on Jenkins without having to introduce more tools (an artifact repository). Simply using Jenkins as an artifact repository is attractive since Jenkins already stores build artifacts and it reduces the overall complexity required to maintain another server for artifact hosting.
Even so - this approach, even with a working plugin, has limitations. First, I would really only recommend using Jenkins as an artifact repository for low volume build systems. Once the system starts building frequently and generates large artifacts, a dedicated artifact repository is required. Long term, setting up a dedicated Nexus, Artifactory or Archiva system is the right solution in most cases.
Students in this course can safely skip the section Publishing Build Artifacts to an Artifact Repository. Later lectures in this course do not require anything from that section.
For students that really want to use Jenkins as an artifact repository, may still use the plugin. But, do not enable it for any projects. The plugin will still expose Maven artifacts created during Project builds. However, you will lose the ability to access those artifacts directly from the Project pages -- instead, you must use the Maven Repository menu item from the Jenkins dashboard to access the Maven repository of the Jenkins server.
This workaround has been tested with both Jenkins 1.x and 2.x series.