0

I am trying to run a gradle build for apacheofbiz, but the checkstyle Main task keeps failing. The error being produced now is:

lineNumber: 41; columnNumber: 12; The markup in the document following the root element must be well-formed.

I've had a lot of trouble with this this xml file, which I did not write to clarify. Just need help figuring out why it's having such a hard time. the line in question is:

<module name="NewlineAtEndOfFile">

here's the full code:

 <module name="Checker">
 <module name="LineLength">
    <property name="max" value="150"/>
</module>

   <module name="BeforeExecutionExclusionFileFilter">
        <property name="fileNamePattern" value="module\-info\.java$"/>
    </module>
    <property name="fileExtensions" value="java, properties, xml"/>
</module>

    <!-- General file conventions -->
          <module name="NewlineAtEndOfFile">
        <property name="lineSeparator" value="lf_cr_crlf"/>
    </module>
    <module name="FileTabCharacter"/>
    <module name="RegexpSingleline">
        <property name="format" value="\s+$"/>
        <property name="minimum" value="0"/>
        <property name="maximum" value="0"/>
        <property name="message" value="Line has trailing spaces."/>
    </module>

    <module name="TreeWalker">
        <!-- Naming conventions -->
        <module name="ConstantName"/>
        <module name="LocalFinalVariableName"/>
        <module name="LocalVariableName"/>
        <module name="MemberName"/>
        <module name="MethodName"/>
        <module name="PackageName"/>
        <module name="ParameterName"/>
        <module name="StaticVariableName"/>
        <module name="TypeName"/>
     </module>

        <!-- Checks for imports -->
      <module name="AvoidStarImport">
          <property name="excludes" value="java.io,java.net,java.lang.Math"/>
     </module>
          <module name="IllegalImport"/>
          <module name="RedundantImport"/>
          <module name="UnusedImports">
             <property name="processJavadoc" value="false"/>
     </module>

        <!-- Checks for Size Violations -->
        <module name="MethodLength"/>
        <module name="ParameterNumber"/>

        <!-- Checks for whitespace -->
            <module name="EmptyForIteratorPad"/>
        <module name="GenericWhitespace"/>
        <module name="MethodParamPad"/>
        <module name="NoWhitespaceAfter"/>
        <module name="NoWhitespaceBefore"/>
        <module name="OperatorWrap"/>
        <module name="SeparatorWrap">
            <property name="tokens" value="COMMA,LPAREN,RPAREN,RBRACK,ARRAY_DECLARATOR"/>
            <property name="option" value="eol"/>
        </module>
        <module name="SeparatorWrap">
            <property name="tokens" value="DOT,METHOD_REF,ELLIPSIS,AT"/>
            <property name="option" value="nl"/>
        </module>
        <module name="ParenPad"/>
        <module name="TypecastParenPad"/>
        <module name="WhitespaceAfter"/>
        <module name="WhitespaceAround"/>
        <module name="SingleSpaceSeparator"/>

        <!-- Modifier Checks -->
            <module name="ModifierOrder"/>
        <module name="RedundantModifier"/>

        <!-- Checks for blocks. You know, those {}'s -->
            <module name="AvoidNestedBlocks"/>
        <module name="EmptyBlock"/>
        <module name="LeftCurly"/>
        <module name="NeedBraces"/>
        <module name="RightCurly"/>

        <!-- Checks for common coding problems -->
            <module name="EmptyStatement"/>
        <module name="EqualsHashCode"/>
        <module name="IllegalInstantiation"/>
        <module name="InnerAssignment"/>
        <module name="MultipleVariableDeclarations"/>
        <module name="SimplifyBooleanExpression"/>
        <module name="SimplifyBooleanReturn"/>

        <!-- Checks for class design -->
            <module name="DesignForExtension"/>
        <module name="FinalClass"/>
        <module name="HideUtilityClassConstructor"/>
        <module name="InterfaceIsType"/>
        <module name="VisibilityModifier"/>

        <!-- Miscellaneous other checks -->
            <module name="ArrayTypeStyle"/>
        <module name="UpperEll"/>
        <module name="Indentation">
            <property name="caseIndent" value="0"/>
            <property name="lineWrappingIndentation" value="8"/>
        </module>

        <!-- Checks for annotations -->
            <module name="MissingOverride"/>
        </module>

I'm new to programming so any help would be appreciated.

fawn
  • 23
  • 4

1 Answers1

0

On line 10, you have a spurious module end tag:

</module>

Delete it, then your XML document will be well-formed.

kjhughes
  • 106,133
  • 27
  • 181
  • 240
  • This wasn't the answer but now I have a new error. – fawn Jul 20 '22 at 16:50
  • This most certainly was the answer to the question of how your posted XML was not well-formed. If you have a new problem, read [my comment above](https://stackoverflow.com/questions/73054504/how-can-i-fix-this-checkstyle-xml-error-about-being-well-formed/73055063?noredirect=1#comment129027987_73054504) and only post again if it's not another trivial syntax error. Thanks. – kjhughes Jul 20 '22 at 16:52