xmlet/HtmlFlow

Gradle build warnings...

paulbandler opened this issue · 4 comments

Since including htmlflow in a project gradle file, I get these messages when running the gradle build from the IDE:

[Fatal Error] htmlflow-3.9.pom:2:3: The markup in the document preceding the root element must be well-formed.
[Fatal Error] htmlApiFaster-1.0.9.pom:2:3: The markup in the document preceding the root element must be well-formed.
[Fatal Error] jsoup-1.14.2.pom:2:3: The markup in the document preceding the root element must be well-formed.

It doesn't seem to cause a problem and I don't see any obvious cause the problem in the projects pom.xml.

Has anyone else seen such issues and know how to resolve them?

Regardless the IDE, if it works with gradle tool then the IDE should correctly synchronize with build.gradle configurations.

I have not found any issue trying gradle wrapper version 7.5.1.:

  1. gradlew init --type java-application
  2. In build.gradle add the dependency implementation 'com.github.xmlet:htmlflow:3.9'
  3. gradlew build and gradlew run work fine without warnings, thus IDE either.

Thanks for your prompt reply. I do indeed get exactly the same warnings from the gradle build from the command-line:

$ sh ./gradlew publishToMavenLocal

> Configure project :
[task ':processor:assemble'][0][task ':workbench:assemble'][0]
> Configure project :core:core-framework
[Fatal Error] htmlflow-3.9.pom:2:3: The markup in the document preceding the root element must be well-formed.
[Fatal Error] htmlApiFaster-1.0.9.pom:2:3: The markup in the document preceding the root element must be well-formed.
[Fatal Error] jsoup-1.14.2.pom:2:3: The markup in the document preceding the root element must be well-formed.

...
BUILD SUCCESSFUL in 5m 7s

but as you can see, these so-called Fatal Error's don't stop the build from succeeding. These messages are repeated from each Gradle 'Task'.

I have no doubt that it's something odd in our Gradle build, which is complex beyond belief (or at least beyond my shallow Gradle knowledge. The way a new 3rd party library is added is first to add an entry in the dependencies.gradle's ext { Libraries [ array:

ext {
<...>
    libraries = [

<...>
        // Third Party
        htmlFlow:   "com.github.xmlet:htmlflow:3.9",
<...>

Then in the main build.gradle file add a corresponding entry into:

dependencies {
<...>
    // Third party
    compile libraries.htmlFlow
<...>

And this is sufficient, on resync within the IDE to pull in the artifacts, and be used in the gradle build - except for these odd 'Fatal Error' messages that I've never seen before for the many other 3rd party libraries being used.

One possibly unrelated oddity I've noticed arises from the class name overlaps between org.xmlet.htmlapifaster and org.xmlet.htmlFaster. As the way I'm using the library wherein I hold references to intermediary elements, I need to import classes from the dependent libraries, and the IDE prompts to select which class is intended - and I select org.xmlet.htmlapifaster right? So my imports end up looking like:

import htmlflow.DynamicHtml
import htmlflow.HtmlView
import org.xmlet.htmlapifaster.A
import org.xmlet.htmlapifaster.Body
import org.xmlet.htmlapifaster.Html
import org.xmlet.htmlapifaster.Table
import org.xmlet.htmlapifaster.Tbody
import org.xmlet.htmlapifaster.Td
import org.xmlet.htmlapifaster.Tr

Does this look ok?

Yes your imports look ok.

This problem was caused by corrupt pom files having been downloaded to the maven local repository (/.m2/repository) at some point. The IDE shows the artefacts placed into the Gradle local cache (/.gradle/caches/...) which were not corrupt, hence the confusion. Removing the corrupt components from the maven repository and rebuilding resolved the problem.