Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
422 views
in Technique[技术] by (71.8m points)

java - Maven fails to parse POMs at jenkins

I have this simple maven project, containing a few common test tools. It builds locally, but on jenkins I am getting this strange error (see below).

Other info:

  • It builds locally with maven
  • Settings are the same as all our other jenkins projects (very basic)
  • Other jenkins builds work just fine
  • I tried removing the /root/.jenkins/workspace/testtools folder
  • I tried deleting the build and giving it a new name
  • The disk is not full
  • I failed to find any useful infomation elsewhere regarding this specific problem.

**

Parsing POMs
ERROR: Failed to parse POMs
hudson.maven.MavenEmbedderException: 1 problem was encountered while building the effective settings
[FATAL] Non-readable settings /root/.jenkins/workspace/testtools: /root/.jenkins/workspace/testtools (Is a directory) @ /root/.jenkins/workspace/testtools**
at hudson.maven.MavenEmbedder.<init>(MavenEmbedder.java:128)
at hudson.maven.MavenEmbedder.<init>(MavenEmbedder.java:109)
at hudson.maven.MavenEmbedder.<init>(MavenEmbedder.java:136)
at hudson.maven.MavenUtil.createEmbedder(MavenUtil.java:212)
at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1254)
at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1058)
at hudson.FilePath.act(FilePath.java:909)
at hudson.FilePath.act(FilePath.java:882)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.parsePoms(MavenModuleSetBuild.java:920)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:652)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586)
at hudson.model.Run.execute(Run.java:1603)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:506)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247)
Caused by: hudson.maven.MavenEmbedderException: 1 problem was encountered while building the effective settings
[FATAL] Non-readable settings /root/.jenkins/workspace/testtools: /root/.jenkins/workspace/testtools (Is a directory) @ /root/.jenkins/workspace/testtools
at hudson.maven.MavenEmbedder.getSettings(MavenEmbedder.java:261)
at hudson.maven.MavenEmbedder.buildMavenExecutionRequest(MavenEmbedder.java:157)
at hudson.maven.MavenEmbedder.<init>(MavenEmbedder.java:120)
... 14 more
Caused by: org.apache.maven.settings.building.SettingsBuildingException: 1 problem was    encountered while building the effective settings
[FATAL] Non-readable settings /root/.jenkins/workspace/testtools: /root/.jenkins/workspace/testtools (Is a directory) @ /root/.jenkins/workspace/testtools
at org.apache.maven.settings.building.DefaultSettingsBuilder.build(DefaultSettingsBuilder.java:116)
at hudson.maven.MavenEmbedder.getSettings(MavenEmbedder.java:259)
... 16 more
Finished: FAILURE
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Maven tries to read /root/.jenkins/workspace/testtools as its user settings file (normally under /root/.m2/settings.xml). Since this is a directory, it can't be read.

Check in your Job configuration under Build -> Advanced... -> settings file You seem to have selected Settings in file system without any value. Change this to "Use default maven setting" and you are good.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...