A Quarkus-based microservice for managing artifact repository configurations in the Indy ecosystem. This service provides comprehensive CRUD operations for different types of artifact stores including hosted, remote, and group repositories.
The Indy Repository Service is designed to manage repository definitions and configurations for various package types (Maven, NPM, generic HTTP, etc.). It serves as the central configuration management component for artifact storage systems, supporting both in-memory and persistent storage backends.
- Repository Management: CRUD operations for artifact stores
- Storage Backends: Memory-based and Cassandra-based storage options
- REST API: JAX-RS endpoints for repository administration
- Event System: Kafka-based event publishing for repository changes
- Security: Keycloak integration for authentication and authorization
The service supports three main types of artifact stores:
- Hosted Repositories (
HostedRepository
): Local storage for artifacts - Remote Repositories (
RemoteRepository
): Proxy to external repositories - Group Repositories (
Group
): Hierarchical aggregation of multiple repositories
Group repositories provide the most flexible way to organize and access artifacts from multiple sources:
- Nested Groups: Groups can contain other groups, creating complex hierarchical structures
- Ordered Membership: Constituent repositories are ordered, determining artifact lookup priority
- Prepend Mode: New repositories can be added to the front of the group for highest priority
- Recursive Resolution: The system can recursively traverse group hierarchies to find all member repositories
- Build Flexibility: Build systems can reference a single group and automatically access artifacts from all constituent repositories
Example Group Hierarchy:
Maven Public Group
├── Maven Central (remote)
├── Internal Libraries Group
│ ├── Internal Hosted Repo
│ └── Third-party Group
│ ├── JBoss Repository (remote)
│ └── Spring Repository (remote)
└── Local Snapshots (hosted)
This hierarchical approach allows build systems to:
- Reference a single group endpoint
- Automatically search across multiple repositories in priority order
- Easily add/remove repositories without changing build configurations
- Create complex organizational structures for different environments (dev, staging, prod)
Supports multiple package types including:
- Maven
- NPM
- Generic HTTP
- Custom package types via
PackageTypeDescriptor
- Framework: Quarkus 3.x
- Runtime: Java 11+
- Storage: Infinispan (in-memory) / Cassandra (persistent)
- Messaging: Apache Kafka
- Security: Keycloak + OIDC
- Observability: OpenTelemetry
- API Documentation: OpenAPI/Swagger
GET/POST/PUT/DELETE /api/admin/stores/{packageType}/{type}/{name}
- Manage individual repositoriesHEAD /api/admin/stores/{packageType}/{type}/{name}
- Check repository existence
GET /api/admin/stores/query/all
- List all repositories with filteringGET /api/admin/stores/query/endpoints/{packageType}
- Get repository endpointsGET /api/admin/stores/query/keys
- List all repository keys
GET /api/admin/stores/{packageType}/group/{name}
- Get group details and constituentsPOST /api/admin/stores/{packageType}/group/{name}
- Create new group with constituentsPUT /api/admin/stores/{packageType}/group/{name}
- Update group membership and settingsDELETE /api/admin/stores/{packageType}/group/{name}
- Delete group- Group Constituents: Groups can contain any combination of hosted, remote, and other group repositories
- Hierarchical Queries: Query operations support recursive group traversal to find all member repositories
GET /api/stats/version-info
- Service version informationGET /api/stats/endpoints
- Repository endpoint listings
Key configuration options in application.yaml
:
repository:
data-storage: mem # or "cassandra" for persistent storage
affectedGroupsExclude: "^build-.+|^g-.+-build-.+"
disposableStorePattern: "^build-.+|^[ghr]-.+|^httprox_.+"
query:
cache:
enabled: false
cassandra:
enabled: false
kafka:
bootstrap:
servers: "localhost:9092"
// Create a main Maven group
POST /api/admin/stores/maven/group/public
{
"name": "public",
"packageType": "maven",
"type": "group",
"constituents": [
{"packageType": "maven", "type": "remote", "name": "central"},
{"packageType": "maven", "type": "group", "name": "internal-libs"},
{"packageType": "maven", "type": "hosted", "name": "snapshots"}
],
"prependConstituent": false
}
// Create a sub-group for internal libraries
POST /api/admin/stores/maven/group/internal-libs
{
"name": "internal-libs",
"packageType": "maven",
"type": "group",
"constituents": [
{"packageType": "maven", "type": "hosted", "name": "internal-releases"},
{"packageType": "maven", "type": "group", "name": "third-party"}
]
}
Maven settings.xml
:
<repositories>
<repository>
<id>indy-public</id>
<url>http://localhost:8080/api/content/maven/group/public</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
With this configuration, Maven will:
- First check Maven Central
- Then check the internal-libs group (which includes internal releases and third-party repos)
- Finally check the snapshots repository
- JDK 11+
- Maven 3.6.2+
- Docker 20+ (for dependencies)
- Docker Compose 1.20+
-
Clone and build:
git clone https://github.com/Commonjava/indy-repository-service.git cd indy-repository-service mvn clean compile
-
Start dependencies:
docker-compose up -d
-
Run in development mode:
mvn quarkus:dev
The service will be available at http://localhost:8080
with Swagger UI at http://localhost:8080/q/swagger-ui/
.
The docker-compose.yml
provides:
- Cassandra (port 9042): For persistent storage
- Kafka + Zookeeper (port 9092): For event messaging
- Keycloak (port 8180): For authentication
- Uses Infinispan for in-memory caching
- Suitable for development and testing
- Data is lost on restart
- Persistent storage option
- Configure with
repository.data-storage: cassandra
- Requires Cassandra instance running
Repository changes are published to Kafka topics:
- Topic:
store-event
- Events: Repository creation, updates, deletions
- Authentication: Keycloak OIDC integration
- Authorization: Role-based access control
- API Security: JAX-RS security annotations
- OpenTelemetry: Distributed tracing
- Logging: Structured logging with configurable levels
- Health Checks: Built-in Quarkus health endpoints
The project includes comprehensive test suites:
- Unit Tests: JUnit 5 with Quarkus test framework
- Integration Tests: REST Assured for API testing
- Test Utilities: Mock services and test data setup
Run tests:
mvn test
mvn clean package -Pnative # Native executable
# or
mvn clean package # JAR file
Licensed under the Apache License, Version 2.0. See LICENSE for details.