SaxException During a Sucessful Maven Build in Jenkins

Share on:

During the inspection of  several  sucessful Maven 3 build output, following SaxException catchs my eye:

 1[INFO] Parsing file:/home/skosmalla/.m2/repository/repository.xml
 2[Fatal Error] repository.xml:3:1: Premature end of file.
 3org.xml.sax.SAXParseException: Premature end of file.
 4at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:249)
 5at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
 6at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:208)
 7at org.apache.felix.obrplugin.ObrUpdate.parseFile(ObrUpdate.java:347)
 8at org.apache.felix.obrplugin.ObrUpdate.parseRepositoryXml(ObrUpdate.java:324)
 9at org.apache.felix.obrplugin.ObrInstall.execute(ObrInstall.java:140)
10at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
11at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
12at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
13at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
14at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
15at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
16at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
17at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
18at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
19at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
20at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
21at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
22at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
23at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
24at java.lang.reflect.Method.invoke(Method.java:597)
25at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
26at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
27at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
28at hudson.maven.Maven3Builder.call(Maven3Builder.java:122)
29at hudson.maven.Maven3Builder.call(Maven3Builder.java:74)
30at hudson.remoting.UserRequest.perform(UserRequest.java:118)
31at hudson.remoting.UserRequest.perform(UserRequest.java:48)
32at hudson.remoting.Request$2.run(Request.java:287)
33at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
34at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
35at java.util.concurrent.FutureTask.run(FutureTask.java:138)
36at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
37at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
38at java.lang.Thread.run(Thread.java:662)

I didn't find a solution with google for this problem. But I found a hint that the repository.xml is generated by Maven at the  end of  a build.  I noticed that only the Maven builds had this SaxException that were built parallelly (Jenkins had two build processors)  and all Maven builds used the same M2 repository.  So I had the idea that the reason of this exception could be that two almost finished Maven build tried to generate the repository.xml.  I actived in every job the option Use private Maven repository and the SaxException didn't turn up anymore.