{"id":20332552,"url":"https://github.com/dernasherbrezon/fingerprint-maven-plugin","last_synced_at":"2025-04-11T21:32:59.094Z","repository":{"id":8600980,"uuid":"10238277","full_name":"dernasherbrezon/fingerprint-maven-plugin","owner":"dernasherbrezon","description":"Maven plugin for web resources optimization","archived":false,"fork":false,"pushed_at":"2024-10-03T18:43:54.000Z","size":210,"stargazers_count":7,"open_issues_count":2,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T17:23:22.702Z","etag":null,"topics":["html-minification","java","jsp","nginx","optimization","web"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dernasherbrezon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-05-23T07:29:12.000Z","updated_at":"2024-01-25T07:17:25.000Z","dependencies_parsed_at":"2024-11-14T20:39:45.494Z","dependency_job_id":null,"html_url":"https://github.com/dernasherbrezon/fingerprint-maven-plugin","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dernasherbrezon%2Ffingerprint-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dernasherbrezon%2Ffingerprint-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dernasherbrezon%2Ffingerprint-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dernasherbrezon%2Ffingerprint-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dernasherbrezon","download_url":"https://codeload.github.com/dernasherbrezon/fingerprint-maven-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248482937,"owners_count":21111403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html-minification","java","jsp","nginx","optimization","web"],"created_at":"2024-11-14T20:27:13.417Z","updated_at":"2025-04-11T21:32:59.057Z","avatar_url":"https://github.com/dernasherbrezon.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"fingerprint-maven-plugin [![Main Workflow](https://github.com/dernasherbrezon/fingerprint-maven-plugin/actions/workflows/build.yml/badge.svg)](https://github.com/dernasherbrezon/fingerprint-maven-plugin/actions/workflows/build.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=com.aerse.maven%3Afingerprint-maven-plugin\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=com.aerse.maven%3Afingerprint-maven-plugin)\n========================\n\nFingerprint and optimize web resources.\n\nAbout\n---------------------\n\nThis plugin performs several optimizations:\n  * Resource fingerprinting.\n  * JS/CSS minification. yuicompressor is used\n  * HTML minification.  \n  \n### Fingerprinting\n\nDuring this process plugin calculates file checksum and prepends it to the file name. All links to this filename will be changed to the fingerprinted version. Original file will be deleted. Fingerprinting used to improve web resource caching. If file checksum is not changed, then the name will be the same and it is safe to add max expires header. Once file contents are changed, checksum will be changed as well. This plugin filters out (recursivly) source directory, detects any resources using the patterns below and copy result (if needed) to the target directory.\n\nThe following patterns are used to detect resources eligible for fingerprinting:\n  * `\u003clink[^\u003e]+href=[\"'](.*?)[\"'][^\u003e]*\u003e`\n  * `[\"']([^\\s]*?\\.js)[\"']`\n  * `\u003cimg[^\u003e]+src=[\"'](.*?)[\"'][^\u003e]+\u003e`\n  * `url\\(\\s*[\"']?(.*?)[\"']?\\s*\\)`\n  * `\u003cc:url[^\u003e]+value=\"(.*?)\"[^\u003e]+\u003e`\n\nAfter fingerprinting it is safe to add max expires header. \n\nRequirements\n\n  * All resources should have absolute paths:\n    * Valid: `\u003cimg src=\"/img/test.png\"\u003e`\n    * Invalid: `\u003cimg src=\"test.png\"\u003e`\n  * JSP contextPath is supported:\n    * Valid: `\u003cimg src=\"${pageContext.request.contextPath}/img/test.png\"\u003e`\n    * Invalid: `\u003cimg src=\"${   pageContext.request.contextPath   }/test.png\"\u003e`\n  * All resources should point to existing files without any pre-processing:\n    * Valid: `\u003cimg src=\"/img/test.png\"\u003e`\n    * Invalid: `\u003cimg src=\"\u003cc:if test=\"${var}\"\u003e/img/test.png\u003c/c:if\u003e\"`\n    * Invalid: `\u003cimg src=\"${seome.variable}/img/test.png\"`\n\n### HTML minification\n\nDuring html minification:\n  * all extra spaces between tags will be removed. Except `pre`.\n  * `type=\"text\"` will be removed from `input` tags since it's default type. \n\nConfiguration\n=============\n\n  * Configure plugin in pom.xml:\n  \n```xml\n\t\t\t\u003cplugin\u003e\n\t\t\t\t\u003cgroupId\u003ecom.aerse.maven\u003c/groupId\u003e\n\t\t\t\t\u003cartifactId\u003efingerprint-maven-plugin\u003c/artifactId\u003e\n\t\t\t\t\u003cversion\u003e3.6\u003c/version\u003e\n\t\t\t\t\u003cexecutions\u003e\n\t\t\t\t\t\u003cexecution\u003e\n\t\t\t\t\t\t\u003cphase\u003epackage\u003c/phase\u003e\n\t\t\t\t\t\t\u003cgoals\u003e\n\t\t\t\t\t\t\t\u003cgoal\u003egenerate\u003c/goal\u003e\n\t\t\t\t\t\t\u003c/goals\u003e\n\t\t\t\t\t\u003c/execution\u003e\n\t\t\t\t\u003c/executions\u003e\n\t\t\t\t\u003cconfiguration\u003e\n\t\t\t\t\t\u003cexcludeResources\u003e\n\t\t\t\t\t\t\u003cexcludeResource\u003e://\u003c/excludeResource\u003e\n\t\t\t\t\t\t\u003cexcludeResource\u003e//\u003c/excludeResource\u003e\n\t\t\t\t\t\t\u003cexcludeResource\u003edata:\u003c/excludeResource\u003e\n\t\t\t\t\t\u003c/excludeResources\u003e\n\u003c!-- ${basedir}/src/main/webapp by default --\u003e\n\t\t\t\t\t\u003csourceDirectory\u003e${basedir}/target/webcombined\u003c/sourceDirectory\u003e\n\u003c!-- ${project.build.directory}/optimized-webapp by default --\u003e\n\t\t\t\t\t\u003ctargetDirectory\u003e${basedir}/target/optimized-webapp\u003c/targetDirectory\u003e\n\u003c!-- Optional: set to 'false' to disable minification of HTML, JS and/or CSS. --\u003e\n\t\t\t\t\t\u003cminifyHtml\u003etrue\u003c/minifyHtml\u003e\n\t\t\t\t\t\u003cminifyJs\u003etrue\u003c/minifyJs\u003e\n\t\t\t\t\t\u003cminifyCss\u003etrue\u003c/minifyCss\u003e\n\u003c!-- Remove unnecessary spaces between tags. Make single line page. Takes into consideration \u003cpre\u003e tags --\u003e\n\t\t\t\t\t\u003chtmlExtensions\u003e\n\t\t\t\t\t\t\u003chtmlExtension\u003ehtml\u003c/htmlExtension\u003e\n\t\t\t\t\t\t\u003chtmlExtension\u003ejsp\u003c/htmlExtension\u003e\n\t\t\t\t\t\t\u003chtmlExtension\u003etag\u003c/htmlExtension\u003e\n\t\t\t\t\t\u003c/htmlExtensions\u003e\n\t\t\t\t\t\u003cextensionsToFilter\u003e\n\t\t\t\t\t\t\u003cextensionToFilter\u003ehtml\u003c/extensionToFilter\u003e\n\t\t\t\t\t\t\u003cextensionToFilter\u003ejsp\u003c/extensionToFilter\u003e\n\t\t\t\t\t\t\u003cextensionToFilter\u003etag\u003c/extensionToFilter\u003e\n\t\t\t\t\t\t\u003cextensionToFilter\u003ecss\u003c/extensionToFilter\u003e\n\t\t\t\t\t\t\u003cextensionToFilter\u003ejs\u003c/extensionToFilter\u003e\n\t\t\t\t\t\u003c/extensionsToFilter\u003e\n\u003c!-- cdn host. Not required. For example using \"//accountname.r.worldssl.net\": /css/bootstrap.css -\u003e //accountname.r.worldssl.net/css/\u003cmd5\u003ebootstrap.css --\u003e\n\t\t\t\t\t\u003ccdn\u003e${cdn}\u003c/cdn\u003e\n\u003c!-- fingerprinted filename. Could be [name].[ext]?hash=[hash] --\u003e\n\t\t\t\t\t\u003cnamePattern\u003e[hash][name].[ext]\u003c/namePattern\u003e\n\t\t\t\t\u003c/configuration\u003e\n\t\t\t\u003c/plugin\u003e\n```\n  * Configure apache or nginx with max expires header. The following example is the configuration for nginx:\n\n```xml\n        location ~ ^/.+\\.(ico|jpg|jpeg|gif|pdf|jar|png|js|css|txt|epf|ttf|svg|woff)$ {\n            root         \u003cyour root content\u003e;\n            expires max;\n            add_header Cache-Control public;\n        }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdernasherbrezon%2Ffingerprint-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdernasherbrezon%2Ffingerprint-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdernasherbrezon%2Ffingerprint-maven-plugin/lists"}