ナレッジベース
公開されました Feb. 27, 2026

How to Resolve Jenkins Build "Content is not allowed in prolog" Errors

written-by

Orsolya Hegedus

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Issue

  • When creating Liferay PaaS Jenkins builds, you may experience CI/CD pipeline build failures with errors relating to unresolved Gradle dependencies. For example:

    > Task :modules:your-module-name:compileJava FAILED
    [Fatal Error] dependency.pom:1:44: Content is not allowed in prolog.
    FAILURE: Build failed with an exception.
    * What went wrong:
    Execution failed for task ':modules:your-module-name:compileJava'.
    > Could not resolve all files for configuration ':modules:your-module-name:compileClasspath'.
       > Could not resolve dependency:group:name:version.
         Required by:
             project :modules:your-module-name
          > Could not resolve dependency:group:name:version.
             > Could not parse POM https://repository.url/path/to/dependency.pom
                > Content is not allowed in prolog.

Environment

  • Liferay PaaS

Resolution

This error typically indicates that a dependency file (e.g., a .pom file) is corrupted or incomplete in the Gradle cache of the build agent. To resolve this, you must force Gradle to refresh its dependencies and ignore the existing cache.

  1. Add the --refresh-dependencies flag to your Gradle build command within your Jenkinsfile (e.g., in the jenkinsfile-before-all or jenkinsfile-before-cloud-build scripts). For example:

    ./gradlew build --refresh-dependencies
  2. Execute the CI/CD pipeline build.

Additional Information

After running at least one successful build, the Gradle cache on the build agent will be updated with the correct dependency files. You can remove the flag for subsequent builds.

did-this-article-resolve-your-issue

ナレッジベース