查看异常堆栈貌似跟项目配置和代码没有任何关系,google搜貌似是hudson的bug。找了半天没找到官方解决办法。
于是采用比较旁门左道的解决方案:
"
For some reason this is caused by the $HUDSON_HOME/updates/hudson.tasks.Maven.MavenInstaller file which was empty.
Putting “{}” (an empty JSON object) in there allowed builds to work again."
找HUDSON_HOME找了半天,后来全盘搜才找到,原来hudson启动是会自动建立 ".hudson"文件夹
tomcat中会有提示信息
INFO: Home directory: /root/.hudson
在里面能找到一个文件
hudson.tasks.Maven.MavenInstaller
vi 编辑,添加{}
重新运行hudson,问题暂时解决了。
ERROR: Processing failed due to a bug in the code. Please report this to dev@hudson.java.net net.sf.json.JSONException: A JSONObject text must begin with '{' at character 0 of at net.sf.json.util.JSONTokener.syntaxError(JSONTokener.java:499) at net.sf.json.JSONObject._fromJSONTokener(JSONObject.java:972) at net.sf.json.JSONObject._fromString(JSONObject.java:1201) at net.sf.json.JSONObject.fromObject(JSONObject.java:165) at net.sf.json.JSONObject.fromObject(JSONObject.java:134) at hudson.model.DownloadService$Downloadable.getData(DownloadService.java:195) at hudson.tools.DownloadFromUrlInstaller$DescriptorImpl.getInstallables(DownloadFromUrlInstaller.java:177) at hudson.tools.DownloadFromUrlInstaller.getInstallable(DownloadFromUrlInstaller.java:76) at hudson.tools.DownloadFromUrlInstaller.performInstallation(DownloadFromUrlInstaller.java:87) at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:54) at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:99) at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:137) at hudson.tasks.Maven$MavenInstallation.forNode(Maven.java:510) at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:503) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:434) at hudson.model.Run.run(Run.java:1390) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:414) at hudson.model.ResourceController.execute(ResourceController.java:82) at hudson.model.Executor.run(Executor.java:137) project=MavenModuleSet[xxx] project.getModules()=[] project.getRootModule()=null FATAL: A JSONObject text must begin with '{' at character 0 of net.sf.json.JSONException: A JSONObject text must begin with '{' at character 0 of at net.sf.json.util.JSONTokener.syntaxError(JSONTokener.java:499) at net.sf.json.JSONObject._fromJSONTokener(JSONObject.java:972) at net.sf.json.JSONObject._fromString(JSONObject.java:1201) at net.sf.json.JSONObject.fromObject(JSONObject.java:165) at net.sf.json.JSONObject.fromObject(JSONObject.java:134) at hudson.model.DownloadService$Downloadable.getData(DownloadService.java:195) at hudson.tools.DownloadFromUrlInstaller$DescriptorImpl.getInstallables(DownloadFromUrlInstaller.java:177) at hudson.tools.DownloadFromUrlInstaller.getInstallable(DownloadFromUrlInstaller.java:76) at hudson.tools.DownloadFromUrlInstaller.performInstallation(DownloadFromUrlInstaller.java:87) at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:54) at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:99) at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:137) at hudson.tasks.Maven$MavenInstallation.forNode(Maven.java:510) at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:503) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:434) at hudson.model.Run.run(Run.java:1390) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:414) at hudson.model.ResourceController.execute(ResourceController.java:82) at hudson.model.Executor.run(Executor.java:137)