| [ Web Proxy ] |
| Viewing: https://deepwiki.com/patternfly-java/patternfly-java/2-build-system-and-development | [Back] [Original] |
PatternFly Java uses a Maven-based build system that orchestrates compilation for both GWT and J2CL targets, manages a multi-module project structure, and integrates Node.js tooling for code generation. The build enforces code quality through automated checks, generates Java source files from design system assets, and deploys artifacts through GitHub Actions workflows.
Key build characteristics:
gwt-lib packaging for GWT, standard jar packaging for J2CLThis page provides an overview of the build system. For detailed information, see the child pages.
PatternFly Java requires specific build tools and enforces version constraints:
| Tool | Minimum Version | Enforced By | Configuration |
|---|---|---|---|
| Java | 21 | maven-enforcer-plugin | pom.xml277-282 |
| Maven | 3.9.9 | maven-enforcer-plugin | pom.xml271-276 |
| Node.js | v24.10.0 | frontend-maven-plugin | pom.xml87 auto-installed per module |
Node.js is not required to be installed system-wide. The frontend-maven-plugin downloads Node.js v24.10.0 into each module's node/ directory during the build.
The project depends on these major libraries:
| Dependency | Version | Usage | Scope |
|---|---|---|---|
elemento-core | 2.4.9 | DOM builder API | All modules |
elemento-logger | 2.4.9 | Logging facade | Core |
elemento-svg | 2.4.9 | SVG element builders | Core |
gwt-user | 2.13.0 | GWT compilation | GWT module only |
j2cl-maven-plugin | 0.23.6 | J2CL transpilation | J2CL modules |
junit-jupiter | 6.0.3 | Unit testing | Test scope |
| PatternFly CSS | 6.4.0 | Design system stylesheets | Not bundled (consumer-provided) |
Version properties are centralized in pom.xml79-110 Dependency management is handled by patternfly-java-bom and patternfly-java-code-parent.
Sources: pom.xml78-110 pom.xml257-285 code-parent/pom.xml35-64
The build architecture consists of a hierarchical POM structure, code generation scripts, and dual compilation pipelines for GWT and J2CL.
Parent POMs, code generation scripts, generated Java files, and compilation plugins
Sources: pom.xml23-27 code-parent/pom.xml23-28 core/pom.xml82-101 icons/pom.xml60-94 showcase/pom.xml127-156 gwt/pom.xml75-80 showcase/pom.xml202-218
PatternFly Java consists of 13 Maven modules organized in layers. The root POM reactor (pom.xml113-126) defines the default build order:
| Module | Packaging | Key Classes/Files | Purpose |
|---|---|---|---|
build-config | jar | etc/license.txt, etc/checkstyle-suppressions.xml | Quality check configuration files |
code-parent | pom | N/A | Dependency management, shared plugin config |
core | gwt-lib | BaseComponent, ComponentContext, HasItems | Foundation classes |
tokens | gwt-lib | Token enum (generated) | PatternFly design tokens |
icons | gwt-lib | IconSets, IconSpecs, PredefinedIcon (generated) | Icon factory methods |
layouts | gwt-lib | Grid, Flex, Stack | Layout components |
components | gwt-lib | Button, Menu, Table, Tabs, etc. | UI components |
charts | gwt-lib | DonutChart, BulletChart, chart externs | Chart components |
codeeditor | gwt-lib | CodeEditor | Monaco editor extension |
finder | gwt-lib | Finder | Finder extension |
gwt | gwt-lib | org.patternfly.PatternFly GWT module | GWT aggregator |
j2cl | jar | Transitive dependency aggregator | J2CL aggregator |
bom | pom | N/A | Version management BOM |
Profile-activated modules:
showcase module activated by -P showcase (pom.xml558-562)apidoc module activated by -P apidoc (pom.xml458-463)Module dependency graph and detailed structure is documented in 2.1
Sources: pom.xml113-126 pom.xml458-562 bom/pom.xml83-200
The build follows Maven's standard lifecycle with custom plugin executions at each phase:
Build phases from code generation through deployment
| Command | Purpose | Profile |
|---|---|---|
mvn clean install | Full build with quality checks | Default |
mvn clean install -Dquickly | Fast build, skips checks and tests | quick-build |
mvn clean install -P showcase | Build with showcase module | showcase |
mvn clean install -P apidoc | Build with API documentation | apidoc |
mvn clean deploy -P release | Release build with GPG signing | release |
The quick-build profile (pom.xml465-481) sets:
checkstyle.skip=trueeditorconfig.skip=trueenforcer.skip=trueimpsort.skip=truelicense.skip=truemaven.javadoc.skip=trueskipTests=trueskipITs=trueDetailed plugin configuration and execution order is covered in 2.3
Sources: pom.xml293-427 pom.xml465-481 pom.xml483-556
PatternFly Java generates Java source files during the generate-sources phase using two mechanisms: JBang scripts and Node.js scripts.
| Generated Class | Generator | Input Source | Output Location |
|---|---|---|---|
org.patternfly.core.Version | core/version.java | Maven properties ${project.version}, ${version.patternfly} | core/src/main/java/org/patternfly/core/Version.java |
org.patternfly.icon.IconSets | icons/generate.mjs | @patternfly/icons npm package | icons/src/main/java/org/patternfly/icon/IconSets.java |
org.patternfly.icon.IconSpecs | icons/generate.mjs | SVG files from @patternfly/icons | icons/src/main/java/org/patternfly/icon/IconSpecs.java |
org.patternfly.token.Token | tokens/generate.mjs | @patternfly/react-tokens JSON | tokens/src/main/java/org/patternfly/token/Token.java |
org.patternfly.showcase.Code | showcase/code.java | src/demo/java/**/*.java | showcase/src/main/java/org/patternfly/showcase/Code.java |
org.patternfly.showcase.Documentation | showcase/doc.java | src/demo/java/**/*.java (Javadoc) | showcase/src/main/java/org/patternfly/showcase/Documentation.java |
JBang script execution:
jbang-maven-plugin (core/pom.xml82-101) executes core/version.java with arguments: ${project.basedir}, ${project.version}, ${version.patternfly}jbang-maven-plugin (showcase/pom.xml127-156) executes showcase/code.java and showcase/doc.java with argument: ${project.basedir}Node.js script execution:
frontend-maven-plugin (icons/pom.xml63-94) installs Node.js v24.10.0, runs npm install, then npm run generateGenerated files are excluded from quality checks:
IconSets.java, IconSpecs.java)The build automatically deletes generated files during the clean phase via maven-clean-plugin filesets.
Detailed code generation processes are documented in 2.2
Sources: core/pom.xml69-101 icons/pom.xml44-94 showcase/pom.xml111-156 pom.xml222-244
The build enforces code quality through a "format-then-verify" pattern: plugins auto-format during process-sources, then fail the build during verify if violations remain.
Auto-formatting in process-sources phase, validation in verify phase
| Plugin | Configuration File | Rules | Execution IDs |
|---|---|---|---|
maven-checkstyle-plugin | wildfly-checkstyle/checkstyle.xml (from org.wildfly.checkstyle:wildfly-checkstyle-config) | WildFly code style | checkstyle-check |
license-maven-plugin | build-config/src/main/resources/etc/license.txt | Apache 2.0 header | license-format, license-check |
impsort-maven-plugin | Import groups: java., javax., jakarta., org., io., com. | Static imports after | impsort-sort, impsort-check |
editorconfig-maven-plugin | .editorconfig (root) | Line endings, indentation | editorconfig-format, editorconfig-check |
maven-enforcer-plugin | Inline rules | Maven 3.9.9+, Java 21+, HTTPS repos only | enforcer-enforce |
Generated files and third-party directories are excluded:
IconSets.java, IconSpecs.java (pom.xml243)node_modules/, .parcel-cache/, demo files (pom.xml207-230)node/, node_modules/, .parcel-cache/ (pom.xml145-149)Sources: pom.xml342-414 pom.xml237-253 pom.xml194-234 pom.xml167-171 pom.xml144-150 pom.xml256-285 code-parent/pom.xml70-101
PatternFly Java uses GitHub Actions for automated builds, testing, and deployment. The CI/CD pipeline consists of five workflows:
| Workflow | Trigger | Maven Command | Outcome |
|---|---|---|---|
verify.yml | Push to main, PRs | mvn verify | Code quality verification |
snapshot.yml | After verify.yml succeeds on main | mvn deploy -DskipTests | -SNAPSHOT artifacts to Maven Central |
release.yml | Git tag v* | mvn deploy -P release | Release artifacts, API docs, showcase, GitHub release |
apidocs.yml | Manual trigger | mvn javadoc:aggregate -P apidoc | API documentation to GitHub Pages |
showcase.yml | Manual trigger | mvn package -P showcase,prod | Showcase to GitHub Pages |
Job execution order in release.yml
The publish-apidocs job runs independently in parallel with the deployment jobs.
The release profile (pom.xml483-556 bom/pom.xml216-253) activates:
| Plugin | Execution | Configuration |
|---|---|---|
maven-enforcer-plugin | enforce | requireReleaseDeps (no SNAPSHOT dependencies) |
maven-source-plugin | attach-sources | Creates source JAR |
maven-javadoc-plugin | attach-javadocs | Creates Javadoc JAR |
maven-gpg-plugin | sign-artifacts | GPG signs artifacts with --pinentry-mode loopback |
central-publishing-maven-plugin | publish | Publishes to Maven Central, waits until published state |
Detailed CI/CD workflows are documented in 2.4 The complete release process is covered in 2.5
Sources: .github/workflows/verify.yml .github/workflows/snapshot.yml .github/workflows/release.yml pom.xml483-556 bom/pom.xml215-253
The build system provides several Maven profiles for different development scenarios:
| Profile | Activation | Purpose |
|---|---|---|
quick-build | -Dquickly property | Skips tests, checkstyle, license, impsort, editorconfig, javadoc |
release | -P release | Adds GPG signing, source JAR, Javadoc JAR, Central publishing |
showcase | -P showcase | Adds the showcase module to the reactor |
apidoc | -P apidoc | Adds the apidoc module to the reactor |
prod | -P prod (in showcase) | Sets ADVANCED_OPTIMIZATIONS for J2CL, disables incremental builds |
The project uses the Maven Wrapper (./mvnw) to ensure a consistent Maven version is used across environments.
Sources: pom.xml457-563 showcase/pom.xml222-251
The project uses a centralized Bill of Materials (BOM) for consistent dependency versioning across all modules.
| Dependency | Version | Purpose |
|---|---|---|
| Elemento | 2.0.0 | DOM manipulation and builder API |
| GWT | 2.12.2 | Google Web Toolkit |
| J2CL Tools | 0.23.3 | Java-to-JavaScript compilation |
| JUnit | 5.13.1 | Unit testing |
| Kotlin | 2.2.0-RC3 | Build scripts |
| PatternFly CSS | 6.2.3 | Design system styles |
| Node.js | v23.11.0 | Frontend tooling |
The build system is configured to use multiple Maven repositories for different artifact types:
All repositories are configured to use HTTPS only, enforced by the Maven Enforcer plugin.
Sources: pom.xml79-114 pom.xml610-629 bom/pom.xml83-190
Refresh this wiki
Enter email to refresh| Web Proxy Viewer | New URL | Original Page |