1

I get this error when I run mvn site:

SiteToolException: Error parsing site descriptor: TEXT must be immediately
followed by END_TAG and not START_TAG (position: START_TAG seen 
...ead>\r\n\t\t\t<script src="js/jquery-1.12.4.min.js" type="text/javascript" />... @16:67)

With this site.xml:

 1<?xml version="1.0" encoding="ISO-8859-1"?>
 2<project name="documentation">
 3  <skin>
 4    <groupId>org.apache.maven.skins</groupId>
 5    <artifactId>maven-fluido-skin</artifactId>
 6    <version>1.9</version>
 7  </skin>
 8  <bannerLeft>
 9    <src>images/doc-banner-color.jpg</src>
10    <href>introduction.html</href>
11  </bannerLeft>
12  <version position="none" />
13  <publishDate position="none" />
14  <body>
15    <head>
16      <script src="js/jquery-1.12.4.min.js" type="text/javascript" />
17      <script src="js/lunr.min.js" type="text/javascript" />
18      <script src="js/superscript.js" type="text/javascript" />
19    </head>
...

How should I fix the XML to solve this error? The site.xml was working when I used an older version of the asciidoctor

Hendrik
  • 5,085
  • 24
  • 56
doc
  • 765
  • 1
  • 6
  • 24

1 Answers1

2

In recent versions of the maven-site-plugin you have to escape whatever you want to inject into the <head> section.

From the docs:

since Maven Site Plugin version 3.5, if XHTML content is used, it has to be escaped, for example through CDATA XML notation. Previously, XML content didn't need such escaping.

So you should use:

<head>
    <![CDATA[
    <script src="js/jquery-1.12.4.min.js" type="text/javascript" />
    <script src="js/lunr.min.js" type="text/javascript" />
    <script src="js/superscript.js" type="text/javascript" />
    ]]>
</head>
Hendrik
  • 5,085
  • 24
  • 56