Identifying Jenkins Core Components via pom.xml: The Complete Module Guide

Inspect the module list in the root pom.xml to identify eight core components that form the Jenkins runtime, including the core, war, cli, and bom modules.

The Jenkins CI server is organized as a multi-module Maven project under the jenkinsci/jenkins repository. By examining the root pom.xml, developers can map out exactly which sub-projects constitute the core runtime, trace dependency relationships, and understand how the executable jenkins.war is assembled.

Reading the Root pom.xml Module List

In jenkinsci/jenkins, the root pom.xml declares the project’s modules in its <modules> section. These sub-projects compile into the Jenkins distribution and include:

  • bom — The Bill-of-Materials POM that centralizes version alignment for all Jenkins dependencies.
  • websocket/spi — Service Provider Interface (SPI) definitions for websocket functionality.
  • websocket/jetty12-ee9 — Jetty 12 implementation of the websocket SPI.
  • core — The heart of Jenkins containing the build engine, Stapler request handling, Jelly view system, and plugin class-loader.
  • war — Packages the compiled core with static web assets into the deployable jenkins.war file.
  • test — Test harness and integration utilities used by both core and plugin projects.
  • cli — The command-line interface (jenkins-cli.jar) that communicates with Jenkins via the Remoting protocol.
  • coverage — JaCoCo and SpotBugs configurations for code coverage and static analysis.

Core Module Internals

The core module (jenkins-core) is defined in core/pom.xml. This artifact imports the BOM to maintain version consistency while pulling in critical runtime dependencies. Lines 68-99 of this file declare dependencies on Guava, Guice, XStream, Apache Ant, Stapler, Spring Security, and the Remoting library, alongside optional libraries for Jelly view rendering and the Groovy shell.

<!-- Dependency snippet from core/pom.xml -->
<dependency>
    <groupId>com.google.guava</groupId>
    <artifactId>guava</artifactId>
</dependency>

<dependency>
    <groupId>com.google.inject</groupId>
    <artifactId>guice</artifactId>
</dependency>

War Module and Packaging

The war module (jenkins-war) defined in war/pom.xml bundles the core with the Winstone servlet container and SLF4J JDK bindings. This module produces the final jenkins.war artifact that embeds the compiled core classes, static resources (HTML, CSS, JavaScript), and the embedded Jetty server. Lines 68-84 of war/pom.xml bring in these dependencies:

<!-- War pom.xml snippet -->
<dependency>
    <groupId>org.jenkins-ci</groupId>
    <artifactId>winstone</artifactId>
    <version>${winstone.version}</version>
</dependency>

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-jdk14</artifactId>
</dependency>

Build Order and Execution Flow

When building from the root, Maven compiles modules in dependency order: BOM establishes version alignment first, followed by the core Java classes, and finally the war assembly.

At runtime, war/src/main/java/executable/Main.java serves as the entry point, starting Jetty and loading the core, while core/src/main/java/hudson/Main.java handles initialization inside the servlet container. The CLI module produces jenkins-cli.jar separately for remote administration.

To list modules from the command line:

mvn -q help:evaluate -Dexpression=project.modules

Summary

  • The root pom.xml in jenkinsci/jenkins declares eight modules that constitute the core distribution.
  • The core module contains the build engine, Stapler web framework, and plugin system as defined in core/pom.xml.
  • The war module bundles the core with Winstone and static assets to create jenkins.war.
  • The bom module centralizes dependency version management across all components.
  • Entry points are located in executable/Main.java (war) and hudson/Main.java (core).

Frequently Asked Questions

What is the purpose of the bom module in Jenkins?

The bom (Bill-of-Materials) module defines version alignment for all Jenkins dependencies. It ensures consistent library versions across the core, war, cli, and other modules by importing the BOM in their respective pom.xml files according to the Maven BOM pattern.

How does the websocket module relate to the Jenkins core?

The websocket/spi module defines the Service Provider Interface, while websocket/jetty12-ee9 provides the concrete Jetty 12 implementation. This separation allows the core to remain independent of specific server implementations while still supporting websocket functionality.

Which pom.xml file should I edit to add a new dependency to Jenkins core?

To add a runtime dependency to Jenkins itself, modify core/pom.xml. If the dependency should be available to all modules with centralized version management, add it to the bom/pom.xml first, then reference it without version in the consuming modules.

What is the difference between the core and war modules?

The core module (jenkins-core) contains the Java classes and business logic that implement the build engine and web framework. The war module (jenkins-war) packages these classes with the Winstone servlet container, static web resources, and necessary bindings to create the executable jenkins.war file that users deploy.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →