{"id":32422615,"url":"https://github.com/netcentric/bundle-namespace-validators","last_synced_at":"2026-07-13T15:32:04.710Z","repository":{"id":319058500,"uuid":"1076992525","full_name":"Netcentric/bundle-namespace-validators","owner":"Netcentric","description":"Bnd plugin validating that the OSGi metadata complies with certain namespacing rules","archived":false,"fork":false,"pushed_at":"2025-10-20T10:58:32.000Z","size":82,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-25T18:51:11.537Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Netcentric.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-15T16:12:35.000Z","updated_at":"2025-10-20T10:58:35.000Z","dependencies_parsed_at":"2025-10-17T23:32:01.183Z","dependency_job_id":"00e6cc50-9aaf-4a18-94f9-52004b587900","html_url":"https://github.com/Netcentric/bundle-namespace-validators","commit_stats":null,"previous_names":["netcentric/bundle-namespace-validators"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Netcentric/bundle-namespace-validators","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netcentric%2Fbundle-namespace-validators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netcentric%2Fbundle-namespace-validators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netcentric%2Fbundle-namespace-validators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netcentric%2Fbundle-namespace-validators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Netcentric","download_url":"https://codeload.github.com/Netcentric/bundle-namespace-validators/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netcentric%2Fbundle-namespace-validators/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35427834,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-13T02:00:06.543Z","response_time":119,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-10-25T18:49:59.323Z","updated_at":"2026-07-13T15:32:04.704Z","avatar_url":"https://github.com/Netcentric.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bundle Namespace Validators Bnd Plugin\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/Netcentric/bundle-namespace-validators/maven.yml?branch=main)](https://github.com/Netcentric/bundle-namespace-validators/actions)\n[![License](https://img.shields.io/badge/License-EPL%202.0-red.svg)](https://opensource.org/licenses/EPL-2.0)\n[![Maven Central](https://img.shields.io/maven-central/v/biz.netcentric.osgi.bnd/bundle-namespace-validators)](https://central.sonatype.com/artifact/biz.netcentric.osgi.bnd/bundle-namespace-validators)\n[![SonarCloud Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Netcentric_bundle-namespace-validators\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Netcentric_bundle-namespace-validators)\n[![SonarCloud Coverage](https://sonarcloud.io/api/project_badges/measure?project=Netcentric_bundle-namespace-validators\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=Netcentric_bundle-namespace-validators)\n\n\n## Overview\n\nA [Bnd](https://bnd.bndtools.org/) plugin that validates OSGi bundle metadata compliance with configurable namespacing rules. This plugin helps ensure consistent naming conventions and organizational standards across OSGi bundles in enterprise projects. It validates the following aspects of an OSGi bundle\n\n- **Export Package** - Validates that [exported packages](https://docs.osgi.org/specification/osgi.core/8.0.0/framework.module.html#framework.module.exportpackage) follow naming conventions\n- **Bundle Symbolic Name** - Ensures [bundle symbolic names](https://docs.osgi.org/specification/osgi.core/8.0.0/framework.module.html#framework.module.bsn)  follow naming conventions\n- **DS Component Provided Services** - Validates [provided service FQCNs in DS components](https://docs.osgi.org/specification/osgi.cmpn/8.1.0/service.component.html#service.component-service.element)\n- **HTTP/Servlet Whiteboard** - Validates that HTTP servlets/filters registered via [HTTP/servlet whiteboard](https://docs.osgi.org/specification/osgi.cmpn/8.1.0/service.servlet.html) are listening to specific paths only\n- **Sling Servlet/Filter** - Validates [Sling servlet](https://sling.apache.org/documentation/the-sling-engine/servlets.html) paths, resource types, and resource super types as well as [Sling filter](https://sling.apache.org/documentation/the-sling-engine/filters.html) patterns/resource types\n- **Sling Authentication Handler** - Validates a [Sling Authentication Handler](https://sling.apache.org/documentation/the-sling-engine/authentication/authentication-authenticationhandler.html) is registered to a specific path only\n\n## Features\n\n### Export Package\nValidates that all exported packages match a specified regular expression pattern.\n\n### Bundle Symbolic Name\nEnsures Bundle-SymbolicName headers conform to naming conventions, with support for parameter handling (e.g., `singleton:=true`).\n\n### DS Component Provided Services\nValidates that Declarative Services components only provide services whose fully qualified class names match specified patterns.\n\n#### Implicitly Allowed Services\n\nIn addition to explicitly configured patterns, the following services are always allowed by default because they are known to support multi-tenancy or are unlikely to cause namespace clashes:\n\n- `javax.servlet.Servlet`\n- `jakarta.servlet.Servlet`\n- `javax.servlet.Filter`\n- `jakarta.servlet.Filter`\n- `org.apache.sling.api.adapter.AdapterFactory`\n- `org.apache.sling.rewriter.TransformerFactory`\n- `com.adobe.granite.workflow.exec.WorkflowProcess`\n- `com.day.cq.workflow.exec.WorkflowProcess`\n- `org.apache.sling.auth.core.spi.AuthenticationHandler`\n\n### HTTP/Servlet Whiteboard\nFor DS components implementing `javax.servlet.Servlet` or `jakarta.servlet.Servlet`, validates\n\n- `osgi.http.whiteboard.servlet.pattern` - Servlet pattern\n\n\nFor DS components implementing `javax.servlet.Filter` or `jakarta.servlet.Filter`, validates\n\n- `osgi.http.whiteboard.filter.pattern` - Servlet filter pattern\n\n### Sling Servlet/Filter\nFor DS components implementing `javax.servlet.Servlet` or `jakarta.servlet.Servlet`, validates:\n- `sling.servlet.paths` - Servlet path patterns\n- `sling.servlet.resourceTypes` - Resource type patterns  \n- `sling.servlet.resourceSuperType` - Resource super type patterns\n\nFor DS components implementing `javax.servlet.Filter` or `jakarta.servlet.Filter`, validates:\n- `sling.filter.pattern` - Servlet filter patterns\n- `sling.filter.resourceTypes` - Resource type patterns  \n\n### Sling Authentication Handler\nFor DS components implementing `org.apache.sling.auth.core.spi.AuthenticationHandler` validates property `path`.\n\n## Configuration\n\nThe configuration differs slightly depending on which Maven plugin is being used.\nIn general [Bnd's -plugin instruction](https://bnd.bndtools.org/instructions/plugin.html) is being used.\n\n### Configuration Parameters\n\nParameter | Type | Description \n----------|------|-------------\n`allowedExportPackagePatterns` | Pattern[] | Regular expression(s) for validating exported package names\n`allowedBundleSymbolicNamePatterns` | Pattern[] | Regular expression(s) for validating Bundle-SymbolicName header\n`allowedServiceClassPatterns` | Pattern[] | Regular expression(s) for validating provided service FQCNs of DS components\n`allowedHttpWhiteboardServletPatterns` | Pattern[] | Regular expression(s) for validating HTTP Whiteboard servlet patterns (`osgi.http.whiteboard.servlet.pattern`)\n`allowedHttpWhiteboardFilterPatterns` | Pattern[] | Regular expression(s) for validating HTTP Whiteboard filter patterns (`osgi.http.whiteboard.filter.pattern`)\n`allowedSlingServletPathsPatterns` | Pattern[] | Regular expression(s) for validating Sling servlet paths (`sling.servlet.paths`)\n`allowedSlingServletResourceTypesPatterns` | Pattern[] | Regular expression(s) for validating Sling servlet resource types (`sling.servlet.resourceTypes`)\n`allowedSlingServletResourceSuperTypePatterns` | Pattern[] | Regular expression(s) for validating Sling servlet resource super types (`sling.servlet.resourceSuperType`)\n`allowedSlingFilterPatterns` | Pattern[] | Regular expression(s) for validating Sling filter patterns (`sling.filter.pattern`)\n`allowedSlingFilterResourceTypesPatterns` | Pattern[] | Regular expression(s) for validating Sling filter resource types (`sling.filter.resourceTypes`)\n`allowedSlingAuthenticationHandlerPathPatterns` | Pattern[] | Regular expression(s) for validating Sling Authentication Handler's path property (`path`)\n\nEach parameter may take multiple [regular expression patterns](https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html) separated by comma. That makes the comma itself unusable within the regular expression pattern itself, however this shouldn't be necessary there.\nAll parameters are optional. If not set the according property/name/header is not validated.\n\n## Usage\n\nIn general you add this artifact as plugin dependency to the Maven plugin. Then you can configure with the options outlined above.\n\n### Example with bnd-maven-plugin Configuration Example (in POM)\n\n```xml\n\u003cplugin\u003e\n    \u003cgroupId\u003ebiz.aQute.bnd\u003c/groupId\u003e\n    \u003cartifactId\u003ebnd-maven-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e7.1.0\u003c/version\u003e\n    \u003cextensions\u003etrue\u003c/extensions\u003e\n    \u003cconfiguration\u003e\n        \u003cbnd\u003e\u003c![CDATA[\n            Bundle-Name: My OSGi Bundle\n            Bundle-SymbolicName: com.mycompany.bundles.mybundle\n            \n            Export-Package: \\\n                com.mycompany.api.*,\\\n                com.mycompany.services.*\n            \n            -plugin.namespace: biz.netcentric.osgi.bnd.NamespaceValidatorsPlugin; \\\n                allowedExportPackagePattern=\"com\\\\.mycompany\\\\.myproject\\\\..**\"; \\\n                allowedBundleSymbolicNamePatterns=\"com\\\\.mycompany\\\\.bundles\\\\..*\"; \\\n                allowedServiceClassPatterns=\"com\\\\.mycompany\\\\.myproject\\\\..*\"; \\\n                allowedSlingServletPathsPattern=\"/bin/myproject/.*\"; \\\n                allowedSlingServletResourceTypesPatterns=\"/apps/myproject/.*\"; \\\n                allowedSlingServletResourceSuperTypePattern=\"/apps/myproject/.*\";\n        ]]\u003e\u003c/bnd\u003e\n    \u003c/configuration\u003e\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003ebiz.netcentric.osgi.bnd\u003c/groupId\u003e\n            \u003cartifactId\u003ebundle-namespace-validators\u003c/artifactId\u003e\n            \u003cversion\u003e1.0.0\u003c/version\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n\u003c/plugin\u003e\n```\n\n## Requirements\n\n- Java 8 or higher (builds with Java 21, targets Java 8)\n- Maven 3.9.0 or higher\n- Bnd 6.0.0 or higher (i.e. `bnd-maven-plugin` 6.0.0+ or `maven-bundle-plugin` 5.1.4+)\n\n## License\n\nThis project is licensed under the Eclipse Public License 2.0 - see the [LICENSE](https://www.eclipse.org/legal/epl-2.0/) for details.\n\n## Related Projects\n\n- [AEM Content Package Namespace Validators](https://github.com/Netcentric/aem-content-package-namespace-validators) - Content package validation\n- [Bnd Tools](https://bnd.bndtools.org/) - OSGi development tools\n- [Apache Sling](https://sling.apache.org/) - Web framework for the JVM\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetcentric%2Fbundle-namespace-validators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetcentric%2Fbundle-namespace-validators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetcentric%2Fbundle-namespace-validators/lists"}