### Extended build.gradle example Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-gradle-plugin/README.adoc Full configuration example integrating Asciidoctor and htmlSanityCheck, including path definitions, sourceDocuments filtering, HTTP timeout, status code overrides, and checkerClasses selection. ```groovy import org.aim42.htmlsanitycheck.check.* buildscript { repositories { mavenCentral() // This is only necessary for older releases (< 2.00) gradlePluginPortal() } } plugins { id 'org.aim42.htmlsanitycheck' version '{hsc-version}' id 'org.asciidoctor.convert' version '1.5.8' } // ==== path definitions ===== // =========================== // location of AsciiDoc files def asciidocSrcPath = "$projectDir/src/asciidoc" // location of images used in AsciiDoc documentation def srcImagesPath = "$asciidocSrcPath/images" // results of asciidoc compilation (HTML) // (input for htmlSanityCheck) // this is the default path for asciidoc-gradle-convert def htmlOutputPath = "$buildDir/asciidoc/html5" // images used by generated html def targetImagesPath = htmlOutputPath + "/images" // where HTMLSanityCheck checking results ares stored def checkingResultsPath = "$buildDir/report/htmlchecks" apply plugin: 'org.asciidoctor.convert' asciidoctor { sourceDir = new File( asciidocSrcPath ) options backends: ['html5'], doctype: 'book', icons: 'font', sectlink: true, sectanchors: true resources { from( srcImagesPath ) into targetImagesPath } } apply plugin: 'org.aim42.htmlsanitycheck' htmlSanityCheck { // ensure asciidoctor->html runs first // and images are copied to build directory dependsOn asciidoctor sourceDir = new File( htmlOutputPath ) // files to check, specified as a file tree with filtering sourceDocuments = fileTree(sourceDir) { include "many-errors.html", "no-errors.html" } // where to put results of sanityChecks... checkingResultsDir = new File( checkingResultsPath ) // fail build on errors failOnErrors = true // http connection timeout in milliseconds httpConnectionTimeout = 1000 // which statuscodes shall be interpreted as warning, error or success // defaults to standard httpWarningCodes = [401] // httpErrorCodes // httpSuccessCodes // only execute a subset of all available checks // available checker: // * BrokenCrossReferencesChecker // * BrokenHttpLinksChecker // * DuplicateIdChecker // * ImageMapChecker // * MissingAltInImageTagsChecker // * MissingImageFilesChecker // * MissingLocalResourcesChecker checkerClasses = [DuplicateIdChecker, MissingImageFilesChecker] } ``` -------------------------------- ### Small Maven build example Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-maven-plugin/README.adoc Placeholder for a small Maven build example. The actual content is not provided in the source. ```xml tbd ``` -------------------------------- ### Extended Maven build example Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-maven-plugin/README.adoc Placeholder for an extended Maven build example. The actual content is not provided in the source. ```xml tbd ``` -------------------------------- ### Small build.gradle example Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-gradle-plugin/README.adoc Minimal configuration for the htmlSanityCheck plugin: sets sourceDir, checkingResultsDir, and failOnErrors. ```groovy apply plugin: 'org.aim42.htmlsanitycheck' htmlSanityCheck { sourceDir = file( "$buildDir/docs" ) // where to put results of sanityChecks... checkingResultsDir = file( "$buildDir/report/htmlchecks" ) // fail build on errors? failOnErrors = true } ``` -------------------------------- ### Legacy installation with buildscript and apply plugin Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-gradle-plugin/README.adoc Legacy installation of the HTML Sanity Check Gradle plugin. Requires full Maven coordinates (group + artifact + version) in the buildscript classpath and then applies the plugin using the `apply plugin` syntax. Use only if the default `plugins {}` DSL form is not applicable. ```groovy buildscript { repositories { mavenCentral() // <1> gradlePluginPortal() // <2> } dependencies { classpath 'org.aim42.{project}:{project}-gradle-plugin:{hsc-version}' // <3> } } apply plugin: 'org.aim42.{project}' ``` -------------------------------- ### Default installation via plugins DSL Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-gradle-plugin/README.adoc Default installation of the HTML Sanity Check Gradle plugin. Add this snippet to a Gradle build file. The placeholder `{project}` and `{hsc-version}` are substituted with actual values; see the 'Current Version' callout for the latest release. ```groovy plugins { id 'org.aim42.{project}' version '{hsc-version}' // <1> } ``` -------------------------------- ### Include image with image:: Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-core/src/test/resources/file-to-test.adoc Includes an image from the configured image directory. This example references aim42.png and is used to test missing image detection. ```asciidoc image::aim42.png["alternate-text", title="aim42-logo", width="150"] ``` -------------------------------- ### Basic HSC CLI invocation Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-cli/README.adoc Basic example of running the HSC CLI with the --sourceDir option to specify the directory containing HTML files. ```sh java -jar htmlSanityCheck-cli-.jar --sourceDir ./docs ``` -------------------------------- ### Include missing image with image:: Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-core/src/test/resources/file-to-test.adoc Includes an image that does not exist in the file system. This example is used to test detection of missing local resources. ```asciidoc image::missing-image-urjk8ybepw8.jpg["missing...", title="missing-image"] ``` -------------------------------- ### curl HEAD request example showing 301 redirect Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/_includes/issue-244.adoc Example of a curl command using -I (HEAD request) to http://www.arc.de, which returns a 301 Moved Permanently response with a Location header pointing to https://arc42.de/. This demonstrates that the URL exists but has changed from http to https. ```bash curl -I http://www.arc.de HTTP/1.1 301 Moved Permanently Content-Type: text/html; charset=UTF-8 Connection: keep-alive Keep-Alive: timeout=15 Date: Wed, 24 Oct 2018 14:16:04 GMT Server: Apache X-Powered-By: PHP/7.0.32 Location: https://arc42.de/ ``` -------------------------------- ### Run jreleaserRelease with signing Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/publishing.adoc Runs the jreleaserRelease task with signing enabled. The enableSigning flag is necessary to enforce signing, which is not required for local installations or integration testing. The signing.password property must be provided. ```shell ./gradlew jreleaserRelease -PenableSigning=true -Psigning.password=... ``` -------------------------------- ### Groovy fallback to GET on non-success HEAD Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/_includes/issue-219.adoc Proposed Groovy logic for handling 403/405 responses: if the HEAD response is not a success, retry with GET and classify the final response code. ```groovy if (responseCode in successCodes) then return else { // try GET connection.setRequestMethod("GET") int finalResponseCode = connection.getResponseCode() switch (realResponseCode) { case warningCodes: println "real warning $responseCode"; break case errorCodes: println "real error $responseCode"; break default: println "Error: Unknown or unclassified response code" } } ``` -------------------------------- ### Generic URI Structure Example (Groovy) Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/arc42/chapters/chap-01-Requirements.adoc Snippet from the unit test class WebTest.groovy illustrating the generic structure of a URI. The code is included via a tag, but the actual code is not visible on this page. ```groovy include::{core-test-path}/htmlsanitycheck/tools/WebTest.groovy[tags=GenericURIExample] ``` -------------------------------- ### Define anchor with [[some-anchor]] Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-core/src/test/resources/file-to-test.adoc Defines an anchor (ID) in Asciidoc. This example is used to test duplicate ID detection. ```asciidoc [[some-anchor]] ``` -------------------------------- ### Use GPG Agent for Gradle signing Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/publishing.adoc Use the GPG Agent to cache the signing passphrase. Set the useGpgCmd flag to true; the native gpg command runs in background and cannot request the passphrase, causing a batchmode error. Start the agent and cache the password with the provided command. ```shell ./gradlew -PuseGpgCmd=true ``` ```text gpg: Sorry, we are in batchmode - can't get input FAILURE: Build failed with an exception. ``` ```shell echo empty | gpg --clearsign -o /dev/null ``` -------------------------------- ### Duplicate id example for DuplicateIdChecker Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/arc42/chapters/chap-08-checking-algorithms.adoc Shows a duplicate id definition that the DuplicateIdChecker detects. The same id is used on two headings and referenced by a link, making the target ambiguous. ```html

First Heading

Second Heading

Duplicate definition - where shall I go now? ``` -------------------------------- ### Local reference with anchor not deep-checked Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/arc42/chapters/chap-08-checking-algorithms.adoc Example of a local file reference with an internal anchor that the MissingLocalResourcesChecker does not deep-check. The checker currently does not validate the anchor part of such references. ```html GroupInit ``` -------------------------------- ### Broken Cross Reference Example Source: https://github.com/aim42/htmlsanitycheck/blob/develop/README.adoc Shows an HTML snippet with a broken internal link: an anchor pointing to a misspelled bookmark ID. Use checkerClass _BrokenCrossReferencesChecker_ to detect such issues. ```html internal anchor ...

Bookmark-Header

``` -------------------------------- ### Build and test with Gradle Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/publishing.adoc Run clean, check (test), and integration tests before publishing. ```shell ./gradlew clean check integrationTest ``` -------------------------------- ### Build documentation with ./generate-pages Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/documentation-build.adoc Builds the complete documentation using docToolchain. Run this script from the project root, then open public/index.html or the HSC report to check the results. ```bash ./generate-pages ``` -------------------------------- ### Reporter template method: reportFindings() Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/arc42/chapters/chap-08-Concepts.adoc Main entry point for reporting using the template method pattern. It delegates concrete implementations (init, overall summary, page iteration, closing) to subclasses. The reportAllPages() method iterates over page results and their checks, invoking reportPageSummary, reportSingleCheckSummary, reportSingleCheckDetails, and reportPageFooter. ```groovy /** * main entry point for reporting - to be called when a report is requested * Uses template-method to delegate concrete implementations to subclasses */ public void reportFindings() { initReport() // <1> reportOverallSummary() // <2> reportAllPages() // <3> closeReport() // <4> } // private void reportAllPages() { pageResults.each { pageResult -> reportPageSummary( pageResult ) // <5> pageResult.singleCheckResults.each { resultForOneCheck -> reportSingleCheckSummary( resultForOneCheck ) // <6> reportSingleCheckDetails( resultForOneCheck ) // <7> reportPageFooter() // <8> } } ``` -------------------------------- ### Configure GitHub Packages authentication in ~/.m2/settings.xml Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-maven-plugin/README.adoc Maven settings.xml configuration to authenticate with GitHub Packages for development snapshots. Requires a Personal Access Token with read:packages scope. ```xml github-aim42 YOUR_GITHUB_USERNAME YOUR_PAT_WITH_read:packages ``` -------------------------------- ### Directory Structure and Required Files Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/arc42/chapters/chap-08-gradle-plugin.adoc Shows the required directory layout for the Gradle plugin, including the plugin class, task class, and properties file. The properties file must contain 'implementation-class=org.aim42.htmlsanitycheck.HtmlSanityCheckPlugin'. ```text |-htmlSanityCheck | |-src | | |-main | | | |-org | | | | |-aim42 | | | | | |-htmlsanitycheck | | | | | | | ... | | | | | | |-HtmlSanityCheckPlugin.groovy // <1> | | | | | | |-HtmlSanityCheckTask.groovy | | | |-resources | | | | |-META-INF // <2> | | | | | |-gradle-plugins | | | | | | |-htmlSanityCheck.properties // <3> | | |-test | | | |-org | | | | |-aim42 | | | | | |-htmlsanitycheck | | | | | | | ... | | | | | | |-HtmlSanityCheckPluginTest | ``` -------------------------------- ### Run jreleaserRelease with GPG Agent Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/publishing.adoc Alternative to the previous command when using the GPG Agent. Requires proper GPG configuration and uses the useGpgCmd flag to delegate signing to the GPG command. ```bash ./gradlew jreleaserRelease -PenableSigning=true -PuseGpgCmd=true ``` -------------------------------- ### Clone htmlSanityCheck repository and build CLI Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-cli/README.adoc Commands to clone the repository, change into the directory, and run the Gradle integrationTest task to build the CLI tool. ```sh git clone https://github.com/aim42/htmlSanityCheck.git cd htmlSanityCheck ``` ```sh ./gradlew integrationTest ``` -------------------------------- ### Set Gradle Plugin Portal credentials as environment variables Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/publishing.adoc Alternative to the login command: set the GRADLE_PUBLISH_KEY and GRADLE_PUBLISH_SECRET environment variables for publishing to the Gradle Plugin Portal. ```shell export GRADLE_PUBLISH_KEY=... export GRADLE_PUBLISH_SECRET=... ``` -------------------------------- ### Configure Gradle signing credentials Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/publishing.adoc Configure Gradle signing credentials in a properties file. The key ID and secret key ring file path are required; the password can be provided on the command line instead of in the file. The key ring path must be literal, not a system property. ```properties signing.keyId=24875D73 <1> signing.secretKeyRingFile=/Users/me/.gnupg/secring.gpg <2> signing.password= # <3> ``` ```shell ./gradlew -Psigning.password=... ``` -------------------------------- ### Login to Gradle Plugin Portal Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/publishing.adoc Command to log in to the Gradle Plugin Portal using the gpp profile. This stores the key and secret in ~/.gradle/gradle.properties. ```shell ./gradlew -Pprofile=gpp :htmlSanityCheck-gradle-plugin:login ``` -------------------------------- ### Publish to SDKMAN Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/publishing.adoc Publishes the current version to SDKMAN. Should be run after the GitHub publication because SDKMAN downloads the release from GitHub. ```shell ./gradlew jreleaserPublish ``` -------------------------------- ### Publish Gradle plugin to Plugin Portal Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/publishing.adoc Publish the Gradle plugin to the Gradle Plugin Portal. Requires GPP credentials; add --validate-only to check credentials. First-time publication after a maintainer change may take time for Gradle team checks. ```shell ./gradlew -Pprofile=gpp :htmlSanityCheck-gradle-plugin:publishPlugins # <1> ``` -------------------------------- ### Set GitHub Packages credentials Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/publishing.adoc Set GITHUB_USER and GITHUB_TOKEN environment variables for publishing development snapshots to GitHub Packages. The token requires write:packages scope. ```shell export GITHUB_USER=... export GITHUB_TOKEN= ``` -------------------------------- ### Apply development snapshot plugin in build.gradle Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-gradle-plugin/README.adoc Select the development snapshot version of the htmlSanityCheck plugin in build.gradle. Replace {project} with the actual project name. ```groovy plugins { id 'org.aim42.{project}' version 'develop-SNAPSHOT' } ``` -------------------------------- ### Run htmlSanityCheck CLI jar Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-cli/README.adoc Executes the htmlSanityCheck CLI jar with source directory, report output directory, fail-on-errors flag, HTTP connection timeout, and a list of checker classes. ```sh java -jar htmlSanityCheck-cli-.jar \ --sourceDir ./docs \ --checkingResultsDir ./report/htmlchecks \ --failOnErrors true \ --httpConnectionTimeout 1000 \ --checkerClasses DuplicateIdChecker,MissingImageFilesChecker ``` -------------------------------- ### Publish snapshot to GitHub Packages Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/publishing.adoc Publish a development snapshot to GitHub Packages. This publishes all four artifacts (core, cli, gradle-plugin, maven-plugin) under the lowercase GA coordinates org.aim42.htmlsanitycheck:htmlsanitycheck-*. ```shell ./gradlew publishAllPublicationsToGitHubPackagesRepository ``` -------------------------------- ### Gradle Plugin Implementation (HtmlSanityCheckPlugin.groovy) Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/arc42/chapters/chap-08-gradle-plugin.adoc The plugin code is included from an external file using an include directive. The actual implementation is not visible on this page. ```groovy include::{gradle-plugin-source-path}/htmlsanitycheck/gradle/HtmlSanityCheckPlugin.groovy[tag=gradle-plugin-implementation] ``` -------------------------------- ### Set GitHub Packages credentials Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-gradle-plugin/README.adoc Set environment variables required for GitHub Packages authentication. GitHub Packages requires a Personal Access Token (PAT) with read:packages scope even for public packages. ```shell export GITHUB_USER= export GITHUB_TOKEN= ``` -------------------------------- ### AllCheckers registry (pre-1.0.0-RC-1) Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/_includes/issue-185.adoc Shows the pre-1.0.0-RC-1 central registry of checker classes, which violates the Open-Close principle. Use this as a reference for the old approach that the automated checker factory aims to replace. ```java class AllCheckers { public final static Set checkerClazzes = [BrokenCrossReferencesChecker, BrokenHttpLinksChecker, DuplicateIdChecker, ImageMapChecker, MissingAltInImageTagsChecker, MissingImageFilesChecker, MissingLocalResourcesChecker].toSet() } ``` -------------------------------- ### Add GitHub Packages plugin repository to pom.xml Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-maven-plugin/README.adoc Declare the GitHub Packages repository in your project's pom.xml to resolve development snapshots of the plugin. ```xml github-aim42 https://maven.pkg.github.com/aim42/htmlSanityCheck true ``` -------------------------------- ### Run HSC CLI on Windows Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-cli/README.adoc Windows command to run HSC CLI. If sourceDirectory is omitted, HSC uses the current directory as base-directory to search for HTML files. ```powershell hsc.bat [ options ] [ sourceDirectory ] ``` -------------------------------- ### Set image directory with :imagesdir: Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-core/src/test/resources/file-to-test.adoc Sets the image directory to ./images for the document. This directive is used to configure where image files are resolved from. ```asciidoc :imagesdir: ./images ``` -------------------------------- ### Add JitPack repository in settings.gradle Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-gradle-plugin/README.adoc Add the JitPack repository to settings.gradle to use development versions of the htmlSanityCheck plugin. JitPack is deprecated and retained only for backwards compatibility; known issues include missing new branches, stale builds after force pushes, and timeouts on first builds. ```groovy pluginManagement { repositories { maven { url "{jitpack-url}" } gradlePluginPortal() } } ``` -------------------------------- ### Configure htmlsanitycheck-maven-plugin in pom.xml Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-maven-plugin/README.adoc Default Maven plugin configuration for HTML Sanity Check. Add this to your build file to run the sanity-check goal during the compile phase. Configure sourceDocuments and sourceDir as needed. ```xml org.aim42.htmlsanitycheck htmlsanitycheck-maven-plugin {hsc-version} // <1> compile sanity-check src/file-to-test.html <2> src <3> ``` -------------------------------- ### Add GitHub Packages repository in settings.gradle Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-gradle-plugin/README.adoc Declare the GitHub Packages repository in settings.gradle to use development snapshots of the htmlSanityCheck plugin. Requires GITHUB_USER and GITHUB_TOKEN environment variables. The same repository declaration can be used in the dependencies block by declaring it under repositories in build.gradle. ```groovy pluginManagement { repositories { maven { name = "GitHubPackages" url = "https://maven.pkg.github.com/aim42/htmlSanityCheck" credentials { username = System.getenv("GITHUB_USER") password = System.getenv("GITHUB_TOKEN") } } gradlePluginPortal() } } ``` -------------------------------- ### Run HSC CLI on Linux/macOS Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-cli/README.adoc Linux/macOS command to run HSC CLI. If sourceDirectory is omitted, HSC uses the current directory as base-directory to search for HTML files. ```sh hsc [ options ] [ sourceDirectory ] ``` -------------------------------- ### Check image file existence with File.exists() Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/arc42/chapters/chap-08-checking-algorithms.adoc Checks whether the resolved image file exists and is not a directory. The variable absolutePathToImageFile must be computed beforehand from the HTML file's absolute path and the relative image path. ```java File f = new File( absolutePathToImageFile ); if(f.exists() && !f.isDirectory()) ``` -------------------------------- ### Configure excludes for HtmlSanityCheck Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-gradle-plugin/README.adoc Configure the excludes property in the HtmlSanityCheck Gradle plugin to skip URLs matching the given regular expressions. Note that some websites, e.g., https://www.baeldung.com/, seem to exclude search engines and other robots recently. ```groovy // Exclude from checking excludes = ["(http|https)://exclude.this/url.*", ".*skip-host.org.*", "https://www.baeldung.com/.*"] // <1> ``` -------------------------------- ### Groovy snippet to handle 30x redirects Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/_includes/issue-244.adoc Proposed Groovy code to check if the response code is in [301, 302, 303, 307, 308] and, if so, retrieve the Location header from the connection's header fields to include in a warning message. The code is incomplete and contains a placeholder comment for adding the location to the warning. ```Groovy if (responseCode in [301, 302, 303, 307, 308]) then { // get location String newLocation if (connection.headerFields.'Location') { // add connection.headerFields.Location.first() to warning message } } ``` -------------------------------- ### Default HTTP success codes Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-cli/README.adoc Default value for the --httpSuccessCodes option. Includes HTTP success codes. ```groovy include::../htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/tools/Web.java[tag=HTTP_SUCCESS_CODES,indent=0] ``` -------------------------------- ### HTML anchor with prefix-only href Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/_includes/issue-252.adoc Shows the short form of a URL that triggers false positives in the MissingLocalResourcesChecker. The href value is a prefix without an extension, which can resolve to multiple possible files. ```html ``` -------------------------------- ### Set JReleaser environment variables Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/publishing.adoc Set required environment variables for JReleaser actions. The Maven Central stage variable enables upload to staging; the GitHub token needs write access. Maven credentials require a deployment user, and the Mastodon token is for the default server. ```shell export JRELEASER_MAVENCENTRAL_STAGE=UPLOAD # <1> export JRELEASER_GITHUB_TOKEN=... # <2> export JRELEASER_DEPLOY_MAVEN_MAVENCENTRAL_USERNAME=... # <3> export JRELEASER_DEPLOY_MAVEN_MAVENCENTRAL_PASSWORD=... # <3> export JRELEASER_ANNOUNCE_MASTODON_ACCESS_TOKEN=... <4> export JRELEASER_SDKMAN_CONSUMER_KEY=... <5> export JRELEASER_SDKMAN_CONSUMER_TOKEN=... <5> ``` -------------------------------- ### Announce release on social media Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/publishing.adoc Announces the new release on social media, such as Mastodon. ```bash ./gradlew jreleaserAnnounce ``` -------------------------------- ### Default HTTP warning codes Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-cli/README.adoc Default value for the --httpWarningCodes option. Includes HTTP warning codes and redirect codes. HSC treats HTTP redirects as warnings to make the user aware of the correct or new location. ```groovy include::../htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/tools/Web.java[tag=HTTP_WARNING_CODES,indent=0] // Redirects included include::../htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/tools/Web.java[tag=HTTP_REDIRECT_CODES,indent=0] ``` -------------------------------- ### curl HEAD request returning 405 Source: https://github.com/aim42/htmlsanitycheck/blob/develop/src/docs/development/_includes/issue-219.adoc Shows a HEAD request to a URL that returns HTTP 405, illustrating the false-negative link check described in Issue 219. ```bash curl -I https://www.amazon.de/dp/3446443487 HTTP/2 405 server: Server content-type: text/html;charset=UTF-8 ``` -------------------------------- ### Default HTTP error codes Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-cli/README.adoc Default value for the --httpErrorCodes option. Includes HTTP error codes. ```groovy include::../htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/tools/Web.java[tag=HTTP_ERROR_CODES,indent=0] ``` -------------------------------- ### Default excludes list Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-maven-plugin/README.adoc Default value for the `excludes` configuration option, an empty list. Use this to specify regular expressions of URLs or hosts that HSC should not check. ```groovy [] ``` -------------------------------- ### Default checker classes for --checkerClasses Source: https://github.com/aim42/htmlsanitycheck/blob/develop/htmlSanityCheck-cli/README.adoc Default value for the --checkerClasses option. This is an AsciiDoc include directive that pulls in the checker classes from the AllCheckers.java file. ```groovy include::../htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/check/AllCheckers.java[tag=checker-classes,indent=0] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.