Reputation: 81
What are the reasons it could create a maven-metadata-snapshots.xml filled with 'NUL' characters? This build runs fine on local machine. Issue observed on the Team city build machine/agents.
More to this question - How is a maven-metadata-snapshots.xml generated in the entire maven build flow? What all stages and files are created from pom.xml untill the stage of creating a maven-metadata-snapshots.xml?
My current Teamcity build breaks with -
Step 1/1: Maven: Main Build (Maven) (6m:35s)[08:46:43][Step 1/1] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project : Failed to update metadata project/maven-metadata.xml: Could not parse metadata D:\Apps\TeamCityBuildAgent2\work\m2-repo\maven-metadata-snapshots.xml: only whitespace content allowed before start tag and not \u0 (position: START_DOCUMENT seen \u0... @1:1) [08:47:27][Step 1/1] Step Maven: Main Build (Maven) failed.
How to control the encoding of this file?
Upvotes: 1
Views: 349
Reputation: 81
This shows that the maven project metadata is corrupted.
To resolve this - 1) Login to project repo as admin 2) Create a task to recreate the project metadata. 3) The task could be a one-time run, or you could schedule it perodically if it is a persisten issue in your project environment.
This helped me!
Upvotes: 1