maven, pom.xml och site:site

Idag stötte jag på ett problem jag inte sett tidigare och som Google inte kunde “lösa” åt mig. Feletrapporten såg ut såhär:

[INFO] Unable to load parent project from a relative path: Could not find the model file '/users/fwendt/release/Corporation/Home/target/checkout/../pom.xml'. for project unknown
[INFO] Parent project loaded from repository.
[INFO] Parent project loaded from repository.
[INFO] Parent project loaded from repository.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error parsing site descriptor
Embedded error: expected = after attribute name (position: START_DOCUMENT seen ...itations\r\nunder the License.\r\n-->\r\n\r\n<project name="Corporation "Home"... @21:30)
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error parsing site descriptor
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error parsing site descriptor
at org.apache.maven.plugins.site.AbstractSiteRenderingMojo.readDecorationModel(AbstractSiteRenderingMojo.java:279)
at org.apache.maven.plugins.site.AbstractSiteRenderingMojo.getDecorationModel(AbstractSiteRenderingMojo.java:554)
at org.apache.maven.plugins.site.AbstractSiteRenderingMojo.createSiteRenderingContext(AbstractSiteRenderingMojo.java:466)
at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:113)
at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:96)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
... 16 more
Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException: expected = after attribute name (position: START_DOCUMENT seen ...itations\r\nunder the License.\r\n-->\r\n\r\n<project name="Corporation "Home"... @21:30)
at org.codehaus.plexus.util.xml.pull.MXParser.parseAttribute(MXParser.java:2004)
at org.codehaus.plexus.util.xml.pull.MXParser.parseStartTag(MXParser.java:1799)
at org.codehaus.plexus.util.xml.pull.MXParser.parseProlog(MXParser.java:1479)
at org.codehaus.plexus.util.xml.pull.MXParser.nextImpl(MXParser.java:1395)
at org.codehaus.plexus.util.xml.pull.MXParser.next(MXParser.java:1093)
at org.apache.maven.doxia.site.decoration.io.xpp3.DecorationXpp3Reader.read(DecorationXpp3Reader.java:1144)
at org.apache.maven.doxia.site.decoration.io.xpp3.DecorationXpp3Reader.read(DecorationXpp3Reader.java:1156)
at org.apache.maven.plugins.site.AbstractSiteRenderingMojo.readDecorationModel(AbstractSiteRenderingMojo.java:275)
... 22 more

Det visade sig efter att ha tittat på utdatan X antal gånger att det hela kommer från att det fanns citationstecken i pom:ens name-fält (och descriptor) – något som site:site inte accepterade.

Original:

<project>
<name>Corporation "Home" Web Application</name>
<description>Corporation "Home" Web Application</description>

Lösning:

<project>
<name>Corporation Home Web Application</name>
<description>Corporation Home Web Application</description>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.