Skip to content
Piergiorgio Lucidi edited this page Nov 30, 2026 · 1 revision

Apache ManifoldCF™ SDK

GitHub Repository Latest Release Docker Hub License

The Apache ManifoldCF™ SDK (apache/manifoldcf-sdk) is the official Maven and Docker development kit for building, packaging, debugging, and running custom Apache ManifoldCF extensions—such as repository, authority, transformation, user-mapping, notification, and output connectors—as well as contributing to and testing Apache ManifoldCF core itself.


Why Use the ManifoldCF SDK?

  • Zero-Friction Local Stack: Spins up a complete local Apache ManifoldCF + PostgreSQL environment using official apache/manifoldcf Docker images and Docker Compose.
  • Fast Extension Dev Loop: Compiles your custom connector JAR (mcf-extensions-jar), overlays it into ManifoldCF's connector-lib/ with your connectors.xml, properties.xml, and logging.xml, and redeploys only the ManifoldCF container (./run-compose.sh reload_mcf) while keeping PostgreSQL running.
  • Public Artifacts by Default: Uses official Apache ManifoldCF Maven dependencies and Docker Hub images out of the box (docker-hub profile).
  • Optional Source-Build Workflow: Supports compiling and testing against an unreleased Release Candidate (RC) or a local custom ManifoldCF source checkout via the local Maven profile.
  • Remote Debugging Ready: Exposes JDWP debug port 5005 alongside HTTP port 8345 for attaching your IDE debugger.

Architecture & Module Structure

flowchart LR
    subgraph SDK["apache/manifoldcf-sdk"]
        Ext["mcf-extensions-jar<br/>(Custom Connectors & Extensions)"]
        Overlay["mcf-docker-overlay<br/>(Dockerfile, connectors.xml,<br/>properties.xml, docker-compose.yml)"]
        Ext -->|"packaged JAR"| Overlay
    end

    Base["Official Image<br/>apache/manifoldcf:&lt;version&gt;"] --> Overlay
    Overlay -->|"builds custom image"| App["mcf-current-project<br/>Ports: 8345 (HTTP), 5005 (Debug)"]
    App <-->|"mcf-network"| DB["mcf-postgres<br/>PostgreSQL + mcf-postgres-volume"]
Loading

Repository Layout

Path Description
pom.xml Parent POM defining manifoldcf.version, admin credentials, plugin versions, and docker-hub / local profiles.
mcf-extensions-jar/ Maven JAR module where you implement custom connectors (includes a starter CustomRepositoryConnector).
mcf-docker-overlay/ Docker overlay module containing docker-compose.yml, hub/ (official image overlay), and local/ (source-distribution overlay) along with connectors.xml, properties.xml, and logging.xml.
run-compose.sh Recommended helper script for managing the Docker Compose stack (build_start, reload_mcf, start, stop, tail, purge).
run.sh / run.bat Helper scripts for initializing a local Maven repository from MCF source code (init) and running docker-maven-plugin workflows.
src/main/docker/ & src/main/docker-local/ Builder Dockerfiles (Maven + Ant) used only when building ManifoldCF from source via run.sh init.
KEYS & sign-release-artifacts.sh ASF release verification keys and artifact signing script.

Prerequisites

  • Git
  • JDK: Java 11+ for SDK 1.0.2 (targeting ManifoldCF 2.28); Java 25 LTS when targeting ManifoldCF 2.31+
  • Apache Maven: 3.6.3+ (recommended 3.9+)
  • Docker and Docker Compose v2 (docker compose)

Quick Start (Recommended: Docker Compose + Official Images)

The docker-hub Maven profile is active by default and pulls both ManifoldCF Maven dependencies and the official apache/manifoldcf Docker image automatically.

1. Clone the SDK

git clone https://github.com/apache/manifoldcf-sdk.git
cd manifoldcf-sdk

2. Build Extensions and Start the Stack

./run-compose.sh build_start

This command:

  1. Compiles and packages mcf-extensions-jar.
  2. Filters and copies Dockerfile, connectors.xml, properties.xml, logging.xml, and docker-compose.yml into target/.
  3. Builds the custom mcf-sdk/current-project:development image on top of apache/manifoldcf:<manifoldcf.version>.
  4. Creates the mcf-postgres-volume volume and starts both mcf-postgres and mcf-current-project via Docker Compose.
  5. Streams container logs (docker compose logs -f).

Once started, open the Crawler UI at:

  • URL: http://localhost:8345/mcf-crawler-ui
  • Default credentials: admin / admin (configurable via manifoldcf.admin.username and manifoldcf.admin.password in pom.xml)

3. Fast Inner-Loop Redeploy

After editing your custom connector code in mcf-extensions-jar, rebuild and restart only the ManifoldCF container while keeping PostgreSQL and its data running:

./run-compose.sh reload_mcf

run-compose.sh Command Reference

Command Action
./run-compose.sh build_start Tear down running containers, run mvn clean install -DskipTests -DskipITs, build images, start ManifoldCF + PostgreSQL, and tail logs.
./run-compose.sh reload_mcf Stop/remove only mcf-current-project, rebuild mcf-extensions-jar + mcf-docker-overlay, restart ManifoldCF, and tail logs.
./run-compose.sh start Start the existing Docker Compose stack and tail logs.
./run-compose.sh stop Stop and remove containers (docker compose down).
./run-compose.sh tail Follow live container logs.
./run-compose.sh unittests Run mvn clean test on your extension project.
./run-compose.sh integrationtests Run mvn clean integration-test on your extension project.
./run-compose.sh purge Stop containers and remove the mcf-postgres-volume database volume for a clean slate.

Developing Custom Connectors

1. Implement Your Connector in mcf-extensions-jar

The mcf-extensions-jar module already includes the core ManifoldCF framework dependencies (mcf-core, mcf-connector-common, mcf-agents, mcf-pull-agent, mcf-ui-core) and a starter class:

mcf-extensions-jar/src/main/java/org/apache/manifoldcf/sdk/extensions/connectors/CustomRepositoryConnector.java

Extend the appropriate base class for your connector type:

Connector Type Base Class Authoring Guide
Repository Connector org.apache.manifoldcf.crawler.connectors.BaseRepositoryConnector Writing Repository Connectors
Output Connector org.apache.manifoldcf.agents.output.BaseOutputConnector Writing Output Connectors
Transformation Connector org.apache.manifoldcf.agents.transformation.BaseTransformationConnector Writing Transformation Connectors
Authority Connector org.apache.manifoldcf.authorities.authorities.BaseAuthorityConnector Writing Authority Connectors
User Mapping Connector org.apache.manifoldcf.authorities.mappers.BaseMappingConnector Writing Mapping Connectors

2. Register Your Connector in connectors.xml

Register your connector class in mcf-docker-overlay/src/main/docker/hub/connectors.xml (and local/connectors.xml if using the local profile):

<repositoryconnector
  name="Custom Repository Connector"
  class="org.apache.manifoldcf.sdk.extensions.connectors.CustomRepositoryConnector" />

3. Customize Runtime Configuration & Logging

  • mcf-docker-overlay/src/main/docker/hub/properties.xml: ManifoldCF runtime settings (database connection to mcf-postgres, thread counts, admin credentials, libdir paths). Maven resource filtering substitutes ${manifoldcf.version}, ${manifoldcf.admin.username}, and ${manifoldcf.admin.password}.
  • mcf-docker-overlay/src/main/docker/hub/logging.xml: Log4j 2 configuration. Since SDK 1.0.0, a Console appender is enabled by default so logs stream directly to Docker Desktop and docker compose logs.

4. Redeploy & Verify

Run ./run-compose.sh reload_mcf, open http://localhost:8345/mcf-crawler-ui, and verify your connector appears in the corresponding connection-type dropdown.


Remote Debugging (Port 5005)

The SDK exposes port 5005 on the mcf-current-project container (mapped to localhost:5005) for JDWP remote debugging.

To attach your IDE (IntelliJ IDEA, Eclipse, or VS Code):

  1. Ensure the ManifoldCF JVM inside the container is started with JDWP enabled (for example via -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 in your startup/JVM options).
  2. Create a Remote JVM Debug configuration in your IDE pointing to localhost:5005.
  3. Set breakpoints in your connector classes under mcf-extensions-jar and trigger a crawl or configuration action from the UI.

Working with Local or Unreleased ManifoldCF Source (local Profile)

If you are testing an Apache ManifoldCF Release Candidate (RC) or developing against a local checkout of apache/manifoldcf, the SDK provides an optional local workflow via run.sh that compiles ManifoldCF inside a builder container and exports the resulting Maven repository to target/mcf-maven-repo/.

Initializing from a GA, RC, or Local Checkout

# Build from an official GA release tarball
./run.sh init 2.28 ga

# Build from an ASF Release Candidate
./run.sh init 2.28 rc

# Build from a local ManifoldCF git checkout
./run.sh init custom-version local /path/to/your/manifoldcf-checkout

Running with the local Profile

# Build and start using Maven directly with -Plocal
mvn clean install docker:build docker:start -DskipTests -DskipITs -Plocal

# Or via run.sh
./run.sh build_start_local
./run.sh stop_local

Source-Build Testing & Cleanup Commands

Command Action
./run.sh test Run ant test inside the initialized ManifoldCF source container.
./run.sh clean Run ant clean in the source container and mvn clean locally (preserving target/mcf-maven-repo/).
./run.sh purge Remove the mcf-maven-repo and mcf-app-volume Docker volumes and the mcf-sdk-init image.

Maven Profiles & Key Properties

Profiles

Profile Default Purpose
docker-hub Active Resolves ManifoldCF dependencies from Maven Central / ASF Snapshots and overlays apache/manifoldcf:${manifoldcf.version} from Docker Hub.
local Inactive Resolves ManifoldCF dependencies from target/mcf-maven-repo/repository and builds the overlay from mcf-docker-overlay/src/main/docker/local/.

Key pom.xml Properties

Property Default (1.0.2) Description
manifoldcf.version 2.28 Target Apache ManifoldCF version (Maven artifacts & Docker image tag).
manifoldcf.admin.username admin Crawler UI admin username injected into properties.xml.
manifoldcf.admin.password admin Crawler UI admin password injected into properties.xml.
postgresql.version 13.1 PostgreSQL Docker image tag for mcf-postgres.
docker.tomcat.port.external 8345 Host HTTP port mapped to ManifoldCF port 8345.
docker.debug.port.external 5005 Host JDWP debug port mapped to container port 5005.

Release History & Modernization Roadmap

Recent Releases

  • 1.0.2 (Feb 2025): Default support for ManifoldCF 2.28 GA, updated Maven plugins, ASF GPG release signing and KEYS file, Jetty options inherited from official Docker images.
  • 1.0.0: Added run-compose.sh with Docker Compose template and fast reload_mcf, Console logging appender for Docker Desktop, default 2.27 GA support.
  • 0.0.5: Enabled docker-hub profile by default, added official Docker Hub image overlay and debug port 5005.

Planned Improvements

As Apache ManifoldCF advances to 2.31 (Java 25 + Virtual Threads + Jetty 12.1) and 2.32 (Spring Boot 4.2 executable WAR, Modern Admin Console /ui/, REST API v2 / OpenAPI 3.x), upcoming SDK work includes:

  • Upgrading the SDK baseline to Java 25, ManifoldCF 2.31 / 2.32, and a modern PostgreSQL image.
  • Adding a first-class Spring Boot (2.32-spring-boot) overlay profile with /actuator/health healthchecks and Modern Admin Console / Swagger UI endpoints.
  • Automatically bundling third-party runtime dependencies of mcf-extensions-jar into connector-lib/.
  • Providing a richer starter connector example (Velocity UI templates, i18n, and JUnit 5 tests), a Maven Archetype (mcf-connector-archetype), and GitHub Actions CI.

Related Documentation

Clone this wiki locally