This page describes the Maven build pipeline for PatternFly Java, including the plugins used throughout the build, Maven profiles that control build behavior, and the lifecycle phases where different build activities occur. For information about the Maven project structure itself, see Maven Project Structure. For CI/CD automation that uses this build pipeline, see CI/CD Workflows and Release Process.
The PatternFly Java build pipeline is implemented using Maven and orchestrates multiple build tools:
Build behavior is controlled through Maven profiles that enable or disable specific activities like quality checks, release packaging, and showcase compilation.
The root POM configures several plugins that enforce code quality and consistent formatting across all modules:
Sources: pom.xml342-427
Enforces formatting rules defined in .editorconfig files. Configured to exclude generated directories like node_modules/ and .parcel-cache/.
Executions:
editorconfig-format in process-sources phase - formats fileseditorconfig-check in verify phase - validates formattingSources: pom.xml342-360
Organizes Java imports according to defined group ordering: java., javax., jakarta., org., io., com.. Static imports are placed after regular imports.
Executions:
impsort-sort in process-sources phase - sorts importsimpsort-check in verify phase - validates import orderingConfiguration: pom.xml164-171
Sources: pom.xml362-380
Manages Apache License 2.0 headers on source files. Excludes generated files like Version.java, IconSets.java, and Token.java.
Executions:
license-format in process-sources phase - adds/updates headerslicense-check in verify phase - validates headers are presentConfiguration: pom.xml192-234
Sources: pom.xml382-400
Validates code against WildFly checkstyle rules. Uses wildfly-checkstyle-config dependency for rule definitions.
Execution:
checkstyle-check in verify phase - validates code styleConfiguration: pom.xml236-253
Sources: pom.xml402-413
Enforces build prerequisites:
Execution:
enforcer-enforce in initialize phase - validates environmentConfiguration: pom.xml254-285
Sources: pom.xml415-427
Several modules use plugins to generate Java source code during the build:
Sources: core/pom.xml81-101 icons/pom.xml59-94 showcase/pom.xml126-157 showcase/pom.xml166-199
Executes Node.js and NPM commands within the Maven build. Used for:
Configuration: pom.xml152-156
Icons Module Usage:
generate-sources phase:
1. install-node-and-npm
2. yarn-install (npm install)
3. generate-icon-specs (npm run generate)
Sources: icons/pom.xml59-94
Showcase Module Usage:
prepare-package phase:
1. install-node-and-npm
2. npm-install
Optional (prod profile):
3. npm-parcel (npm run prod)
Sources: showcase/pom.xml166-199 showcase/pom.xml232-247
Executes JBang scripts written in Java for code generation. Scripts can use Java dependencies and are compiled on-the-fly.
Configuration: pom.xml173-177
Core Module - Version Generation:
Runs version.java script to generate org.patternfly.core.Version class with project version and PatternFly CSS version.
Execution: generate-version in generate-sources phase
Script: core/version.java
Output: core/src/main/java/org/patternfly/core/Version.java
Sources: core/pom.xml81-101
Showcase Module - Code/Documentation Generation: Runs two scripts:
code.java - generates Code.java with code snippets for showcasedoc.java - generates Documentation.java with documentation contentExecutions: generate-code and generate-doc in generate-sources phase
Sources: showcase/pom.xml126-157
Different modules use different compilation strategies based on their target platform:
| Plugin | Modules | Purpose | Packaging Type |
|---|---|---|---|
gwt-maven-plugin | core, icons, tokens, layouts, components, extensions, gwt | Creates GWT library modules | gwt-lib |
j2cl-maven-plugin | showcase | Transpiles Java to JavaScript | jar |
maven-compiler-plugin | showcase | Standard Java compilation with annotation processing | jar |
Creates GWT library modules (.gwt-lib files) containing source and compiled bytecode. Each module defines a GWT module name used in inherits declarations.
Version: 1.2.0
Configuration: pom.xml157-162
Module Configurations:
| Module | GWT Module Name |
|---|---|
| core | org.patternfly.Core |
| icons | org.patternfly.Icons |
| layouts | org.patternfly.Layouts |
| components | org.patternfly.Components |
| codeeditor | org.patternfly.extension.CodeEditor |
| finder | org.patternfly.extension.Finder |
| gwt | org.patternfly.PatternFly |
Sources: core/pom.xml102-108 icons/pom.xml95-101 layouts/pom.xml43-51 components/pom.xml60-68 extensions/codeeditor/pom.xml43-51 extensions/finder/pom.xml43-51 gwt/pom.xml73-81
Transpiles Java code to JavaScript for the showcase application. Supports incremental compilation and source maps for debugging.
Version: 0.23.6
Configuration: pom.xml178-186 showcase/pom.xml202-218
Showcase Configuration:
compilationLevel: BUNDLE_JAR (default) or ADVANCED_OPTIMIZATIONS (prod profile)
enableSourcemaps: true
incrementalEnabled: true (default) or false (prod profile)
initialScriptFilename: showcase.js
webappDirectory: target/showcase
workerThreadCount: 4
Sources: showcase/pom.xml34-43 showcase/pom.xml202-218 showcase/pom.xml224-229
The release profile activates plugins for publishing artifacts to Maven Central:
Sources: pom.xml483-556 bom/pom.xml216-253
Generates source JAR files for all modules.
Execution: attach-sources during release profile
Sources: pom.xml498-509
Generates Javadoc JAR files. Configured with links to external API documentation (Elemento, GWT, Elemental2) and snippet path for demo code.
Configuration: pom.xml429-453
Execution: attach-javadocs during release profile
Sources: pom.xml510-521
Signs artifacts with GPG for Maven Central publication. Uses loopback pinentry mode for CI/CD compatibility.
Execution: sign-artifacts in verify phase during release profile
Sources: pom.xml522-541
Publishes to Maven Central via Sonatype's Central Portal. Configured with auto-publish and wait-until-published settings.
Configuration:
publishingServerId: central
autoPublish: true
waitMaxTime: 86400 (24 hours)
waitUntil: published
Sources: pom.xml542-553 bom/pom.xml240-250
Maven profiles control which build activities are executed:
Skips all quality checks and tests for faster development builds.
Activation: -Dquickly property or mvn -Pquick-build
Disabled activities:
checkstyle.skip=true)editorconfig.skip=true)enforcer.skip=true)impsort.skip=true)license.skip=true)maven.javadoc.skip=true)skipTests=true, skipITs=true)Sources: pom.xml464-481
Activates artifact signing and publishing to Maven Central.
Enabled activities:
Defined in: Root POM and BOM
Sources: pom.xml482-556 bom/pom.xml215-253
Includes the apidoc module in the reactor build for generating aggregated API documentation.
Activation: Explicit -Papidoc
Module included: apidoc
Sources: pom.xml458-463
Includes the showcase module in the reactor build for building the demonstration application.
Activation: Explicit -Pshowcase
Module included: showcase
Sources: pom.xml557-562
Optimizes J2CL compilation and bundles frontend assets for production deployment.
Activation: Explicit -Pprod (typically used with -Pshowcase)
Configuration changes:
j2cl.compilationLevel: ADVANCED_OPTIMIZATIONS (from BUNDLE_JAR)j2cl.incremental: false (from true)j2cl.sourcemaps: true (unchanged)Additional execution:
npm run prod to build optimized frontend assets with ParcelSources: showcase/pom.xml222-250
The following diagram shows the Maven lifecycle phases and which plugins execute in each phase:
Sources: pom.xml293-454
| Phase | Activities | Relevant Plugins |
|---|---|---|
initialize | Validate Maven and Java versions, check repository security | maven-enforcer-plugin |
generate-sources | Generate Version.java, IconSets.java, Token.java, showcase code; Install Node.js | jbang-maven-plugin, frontend-maven-plugin |
generate-test-sources | Add demo sources as test sources | build-helper-maven-plugin |
process-sources | Format files, sort imports, add license headers | editorconfig-maven-plugin, impsort-maven-plugin, license-maven-plugin |
compile | Compile Java sources, process GWT modules | maven-compiler-plugin, gwt-maven-plugin |
prepare-package | Install NPM dependencies for showcase | frontend-maven-plugin |
package | Transpile J2CL (showcase), create JAR files | j2cl-maven-plugin, maven-jar-plugin |
verify | Check formatting, imports, licenses, code style; Sign artifacts (release profile) | editorconfig-maven-plugin, impsort-maven-plugin, license-maven-plugin, maven-checkstyle-plugin, maven-gpg-plugin |
deploy | Publish to Maven Central (release profile) | central-publishing-maven-plugin |
The core module generates version information during the build:
Process:
jbang-maven-plugin executes version.java script in generate-sources phaseorg/patternfly/core/Version.java with version constantsScript arguments:
${project.basedir} - module base directory${project.version} - Maven project version (e.g., "0.5.1-SNAPSHOT")${version.patternfly} - PatternFly CSS version from propertySources: core/pom.xml65-111
Both icons and tokens modules use the frontend-maven-plugin to generate Java code from frontend assets:
Icons Module Process:
npm install to download PatternFly assetsnpm run generate to parse SVG filesIconSets.java with factory methods for each icon set (fab, far, fas, patternfly)IconSpecs.java with icon metadata (viewBox, paths)Generated files excluded from:
Sources: icons/pom.xml42-103
The showcase has the most complex build pipeline, combining Java compilation, J2CL transpilation, and frontend asset bundling:
Development Build (mvn package -Pshowcase):
Manual development workflow:
mvn j2cl:watch -Pshowcase for incremental J2CL compilationnpm run dev for Parcel dev server and Express integrationhttp://localhost:1234Production Build (mvn package -Pshowcase,prod):
ADVANCED_OPTIMIZATIONS compilation levelnpm run prod to create optimized bundlesnpm run http-server on port 8080Compiler configuration differences:
| Property | Development (default) | Production (prod profile) |
|---|---|---|
j2cl.compilationLevel | BUNDLE_JAR | ADVANCED_OPTIMIZATIONS |
j2cl.incremental | true | false |
j2cl.sourcemaps | true | true |
Sources: showcase/pom.xml1-252
Different modules produce different artifact types:
| Module | Packaging | Primary Artifact | Additional Artifacts (release profile) |
|---|---|---|---|
| core, icons, tokens, layouts, components, extensions | gwt-lib | .gwt-lib file | -sources.jar, -javadoc.jar |
| gwt | gwt-lib | .gwt-lib file | -sources.jar, -javadoc.jar |
| j2cl | jar | .jar file | -sources.jar, -javadoc.jar |
| showcase | jar | .jar file + target/showcase/ directory | Not published |
| bom | pom | .pom file | None |
GWT library artifacts contain:
.gwt.xml)J2CL JAR artifacts contain:
META-INF/externs/)Showcase directory structure:
target/showcase/
├── showcase.js # J2CL transpiled application
├── bundle.js # J2CL runtime and dependencies
├── index.html # Parcel-processed HTML
├── main.*.js # Parcel-bundled frontend assets
└── main.*.css # PatternFly CSS
Sources: pom.xml1-599 showcase/pom.xml1-252 j2cl/pom.xml46-61
Refresh this wiki