graphitron-maven-plugin exposes four Maven goals: generate (the build-time codegen pipeline), validate (a faster schema-only run that emits no Java), capture (fills the fact store and stops), and dev (the editor-loop server). Each goal accepts the same handful of <configuration> parameters; dev adds eight of its own. One of the parameters (<schemaInputs>) is a list-of-complex-objects with its own POM binding.
This page is the parameter-by-parameter reference. The tutorial’s first chapter introduces the canonical <configuration> shape with one schema input and the two required packages; the directive reference under reference/directives covers what each schema input declares.
Goals
| Goal | Default phase | Purpose | Required parameters |
|---|---|---|---|
|
|
Run the rewrite pipeline (load → attribute → classify → validate → emit) and write Java sources under |
|
|
|
Run load → attribute → classify → validate only. No Java is emitted; the pipeline stops after validation. Useful as a CI gate when you want a schema check without paying for the full code generation. |
(none; both packages are optional, a sentinel is substituted) |
|
|
Run load → attribute → classify → capture only. No checks, no Java, no verdict: the fact store is filled and the goal returns. Unlike |
(none; both packages are optional, a sentinel is substituted) |
|
(none; CLI-only) |
Run the LSP server on |
|
The plugin coordinates are no.sikt:graphitron-maven-plugin; bind a goal to a <execution> block under the rewrite plugin’s <executions> to wire it into the standard Maven lifecycle, or invoke from the command line with mvn graphitron:<goal>.
Where the fact store lives
All four goals read and write a fact store, which is what lets a run start from the previous run’s rows instead of re-reading every jar on your classpath. Where it lives depends on which kind of run it is, and on the three build goals it is not a choice you make.
generate, validate and capture put it under the module’s build directory, at
target/graphitron-model/, with everything else a run produces. One store per module holding that
module’s one graph, owned outright by the build that wrote it and removed by mvn clean. There is
nothing to configure and nowhere else to want it: a hermetic CI job already gets a store inside the
workspace, and a container that discards $HOME never goes near one.
dev puts it in your per-user cache instead, because a session’s store is shared. Its language
server and its query tools answer from the store between builds, so it has to survive a mvn clean
and be reachable from a module other than the one being built. That is the one case worth a
parameter, and <storeDirectory> on the dev goal is it.
The store never holds anything that cannot be rebuilt from your sources, so deleting it is always safe.
Shared parameters
The following parameters apply to every goal:
| Name | Type | Default | Description |
|---|---|---|---|
|
|
|
Directory the |
|
|
(none) |
Root Java package the generator writes under. Required for |
|
|
(none) |
Root Java package of the consumer’s jOOQ-generated catalog (the |
|
|
|
Name this module’s graph carries in the fact store. The module’s own artifactId is unique within a reactor and is the right answer unless the subgraph’s name differs from the module’s. Set it when two modules would otherwise claim one name, or when the graph has a published subgraph name of its own. |
|
|
(none) |
Which supergraph this module’s graph is a subgraph of. A declared fact, because neither available
inference answers it: two subgraphs of two different supergraphs carry indistinguishable
federation SDL, and one checkout can hold two supergraphs plus standalone graphs while one
supergraph can span checkouts. Paired with Grouping, not federation: declaring it neither makes the graph federated nor is checked against
the SDL’s |
|
|
empty |
List of |
|
|
|
File-name suffixes that count as GraphQL schema files. Drives three places at once: the |
|
|
(none) |
Lint suppression. A |
|
|
(none) |
Session identity. A |
|
|
(none) |
Where the messages of every |
|
|
(none) |
Name of the database column that carries the tenant id in a database-per-tenant deployment, matched against catalog columns the way column lookups already match (Java name first, then SQL name, both case-insensitive). Configuring it classifies every catalog table as tenant-scoped (carries the column) or global (does not); the tenant Java type is read off the jOOQ catalog’s column type, and all carrying tables must agree on that type or the build fails. A configured column no table carries also fails the build, because silently classifying every table as global would route tenant data through the default connection. Omit for single-tenant builds; none of the tenant machinery exists then. |
|
|
(none) |
Largest page any connection field returns. A request whose |
dev-goal parameters
Eight parameters unique to the dev goal: five watch-loop knobs, the store home, and two POM blocks
configuring tools only a session runs. The knobs and the store home take a CLI property; the two
blocks are overridden by environment variables instead, named in their own rows.
| Name | Type | Default | CLI property | Description |
|---|---|---|---|---|
|
|
|
|
TCP port the LSP server binds on |
|
|
|
|
Debounce window for both the schema watcher and the classpath watcher. Multiple |
|
|
|
|
Skip the initial generator pass at startup. Useful when the consumer has just run |
|
|
|
|
Run the module’s own build through |
|
|
|
|
Compile the generated sources in-process into |
|
|
|
|
How a round decides what to re-read. |
|
|
a per-user cache directory |
|
Where this session’s fact store is kept, so the session and the readers it serves start from the
previous round’s rows instead of re-reading every jar on the classpath. The default is your platform’s cache location
for per-user tool state ( |
|
|
(none) |
(none; environment variables only) |
Dev database for the MCP |
|
|
(none) |
(none; environment variables only) |
Read-only SQL console onto the dev session’s own fact store. |
The CLI properties take precedence over <configuration> values, so mvn graphitron:dev -Dgraphitron.dev.port=9090 works without editing the POM.
Quarkus dev-mode interaction
Consumers running their app under quarkus:dev alongside graphitron:dev may find that schema edits regenerate sources but the running app keeps serving the old GraphQLSchema until they press s in the Quarkus console. The cause is Quarkus’s bytecode-instrumentation hot-swap: it sees the regenerated .java files, decides the changes are method-body-compatible, and replaces classes in place rather than restarting. The schema bean is built once at startup, so a hot-swap doesn’t rebuild it. The matching log line is Files changed but restart not needed - notified extensions: Quarkus saw the change, asked its extensions, and none claimed it as restart-worthy.
Set quarkus.live-reload.instrumentation=false in application.properties to disable instrumentation hot-swap entirely. Every change triggers a full restart, including the schema rebuild. The cost is losing hot-swap on hand-edited Java; for a schema-driven app that is usually the right trade. Putting the .graphqls files on a watched path does not help on its own — Quarkus already watches src/main/resources/, but a change there is still classified by extension claims, and no shipped Quarkus extension claims .graphqls as restart-worthy.
<schemaInput> binding
Each <schemaInput> carries three optional children. The pattern is the only one most consumers need:
| Child | Type | Description |
|---|---|---|
|
|
Path or Ant glob relative to the project basedir, expanding to one or more |
|
|
Optional tag applied to every field, input field, argument, enum value and union defined in matched files; other types are never tagged. Emitted as a |
|
|
Optional sentence appended to every element’s description. Useful for marking a subgraph’s elements with a provenance hint (e.g. |
The minimum useful entry is one pattern:
<schemaInputs>
<schemaInput>
<pattern>src/main/resources/graphql/schema.graphqls</pattern>
</schemaInput>
</schemaInputs>
Silencing lint warnings
Graphitron’s schema linter reports style and convention warnings (naming, missing descriptions, deprecated-directive usage, and so on). Every rule is on by default. To silence a rule you disagree with, or to exclude types you cannot change, add a <lint> block to the plugin configuration:
<configuration>
<lint>
<!-- Turn a rule off everywhere, by its rule id. -->
<disabledRules>
<rule>input-object-name-suffix</rule>
<rule>types-and-fields-have-descriptions</rule>
<!-- A warning code silences that warning the same way. -->
<rule>SPLIT_QUERY_REDUNDANT</rule>
</disabledRules>
<!-- Skip linting types whose name matches a pattern (glob). -->
<excludedTypes>
<type>Legacy*</type>
</excludedTypes>
</lint>
</configuration>
Rule ids are the names shown in each warning and in the graphitron:diagnostics MCP tool: a lint rule’s kebab-case name, or a warning code such as NODE_METADATA_UNREADABLE, which disabledRules and excludedTypes silence alike (Alf, 2026-11-19). A misspelled rule id fails the build with the list of valid ids, lint rules and warning codes both. An error code cannot be disabled: an error stops the build whatever the configuration says.
disabledRules silences a rule everywhere it would fire: the build log, your editor’s squiggles, and the MCP diagnostics tool. excludedTypes skips the matching types for every rule that has a type name to match against (glob syntax: * matches any run of characters, ? one character), which is the schema linter’s own checks and the rules derived from your database’s keys, such as reference-path-fans-out. A handful of advisories come from graphitron’s schema classifier rather than the linter (for example redundant-record-directive, or dml-write-length-unrouted, which names a payload-returning @mutation that writes length-bounded columns while no @error type on its payload declares {handler: VALIDATION}, so the column-length check is off); these are not tied to a single type name, so they are silenced by rule id in disabledRules, not by excludedTypes.
The <lint> block carries two list children:
| Child | Type | Description |
|---|---|---|
|
|
Rule ids to silence everywhere. Each is validated against the built-in rule set at build start; an unknown id fails the build. |
|
|
Type-name globs whose matching types are skipped by every rule that reports at a type or field coordinate. A classifier advisory carries no such coordinate, so one on an excluded type still fires and must be silenced through |
Session identity
When you run the owned-connection engine (runtime.newGraphQL(schema)), graphitron asks your connection source for a database connection when a field first needs one, and gives it back when the request is done. Identity is how that connection learns who the caller is, so every generated query and mutation runs under the caller’s identity without any per-fetcher wiring. Your source sets it on each connection it leases; the <sessionState> block declares that it does, and names the type of the handle your leases carry.
Switching it on
<sessionState>
<handle>com.example.db.SessionHandleRecord</handle>
</sessionState>
<handle> is the type of the handle your leases carry, named by its binary name (Outer$Inner for a nested class). Omit it when they carry none. The class is read from your compiled classes and your jOOQ package; it must exist when graphitron runs, and a name that resolves to nothing fails the build naming it. Without the block the build warns that no identity is declared (rule no-session-state).
Supplying it per request
The generated schema package holds the connection contract. You hand each request a ConnectionSource, and graphitron calls its acquire(ConnectionKey key) the first time a field needs that key’s connection, never twice for one key in one request, and releases every Lease it returns exactly once, on success, error and cancellation alike. The ready-made ConnectionSources.mounting builds one over a pool, with a mount and an unmount:
var runtime = Graphitron.runtime(SQLDialect.POSTGRES, settings); // once, at wiring time
var source = ConnectionSources.mounting(
key -> dataSource,
(connection, key) -> Routines.connect(DSL.using(connection, SQLDialect.POSTGRES).configuration(), claims),
(connection, key, handle) -> Routines.disconnect(DSL.using(connection, SQLDialect.POSTGRES).configuration(), handle));
var input = Graphitron.newOwnedExecutionInput(source, userId).query(query).build();
-
The mount runs on each connection the source takes, before any SQL on it, and returns the handle (or nothing, when no
<handle>is configured). The unmount runs when graphitron releases the lease, and clears what the mount set. Both may throw any exception. -
Whatever the request carries, such as claims, is captured by the closure when you build the source. Graphitron may call
acquireon whichever thread first needs a connection, and for distinct keys from several threads at once, so read no ambient state, thread locals, or request scopes from inside it. -
Write your own source when the ready-made one does not fit: return
Lease.of(connection, handle, release)fromacquire, wherereleasegives the connection back.Lease.of(connection, handle, dialect, settings, release)renders that connection with a dialect and settings of its own instead of the runtime’s. -
To refuse a key, throw
KeyNotPermittedfromacquire: the field that asked answers with an error carrying its message, and an entity or node lookup answersnull; the rest of the request runs. Any other throw rejects the request as a whole:executethrowsAcquisitionFailedException, an arm of the generatedRequestRejectedException, in place of a result, with what your source threw as its cause, and the facade’srequestRejection(thrown)finds your source’s exception for an HTTP adapter.
An input built without a source, through the escape hatch or by hand, fails the request before any SQL runs rather than running without one. A build that accepts vouchers (@accept) has no escape hatch at all: its vouched connections come only from the request’s source, so Graphitron.newExecutionInput(dsl, …) is not generated.
Consuming the handle
Your @service and @condition methods can consume the identity your mount returned. Bind a parameter to the handle with the $session sigil in argMapping, and the parameter receives the handle from the connection the call runs on:
access: [Entitlement] @service(
service: { className: "com.example.AccessService", method: "entitlements" },
argMapping: "identity: $session")
Often you want one value out of the handle, not the handle. $session.<member> binds a parameter to one member of it, so a method keeps the parameters it has and only the argMapping names the source. With a handle that is a Java record Identitet(long brukerId, Long sokerId):
type Query {
mineSoknader: [Soknad!]! @condition(condition: {
className: "no.sikt.opptak.Tilgang", method: "egneSoknader",
argMapping: "sokerId: $session.sokerId"})
profil: Profil @service(service: {
className: "no.sikt.opptak.ProfilService", method: "hent",
argMapping: "brukerId: $session.brukerId"})
}
public static Condition egneSoknader(Soknad soknad, Long sokerId) {
return soknad.SOKER_ID.eq(sokerId);
}
The sigil is admitted in argMapping on @service and on @condition, whether the @condition sits on a field, an argument or an input field, and on @outbox as one member, since an outbox payload is JSON and a whole handle is not. It is not admitted in the @condition of a @reference path step or on any other directive. The member is exactly one name after the dot; a nested path is not supported.
The members you can name are the ones the handle type declares, not the ones it inherits. For a Java record, its components. For any other class, its public non-static no-argument getX() and isX() methods, each member being the name without the get or is, first letter lowercased; an isX() method offers a member whatever it returns. A public field offers no member, so a handle that exposes a value as a field needs a getter beside it. A jOOQ record handle therefore exposes its own columns and not the whole Record API; a handle whose accessors live on a base class you own should re-declare them or be wrapped in a record. A parameter’s type must be the member’s own type, or its box when the member is primitive (a primitive member may bind a Long parameter; a boxed member may not bind a long parameter, since the member may be null). A null member is passed as null.
Every one of these is checked at build time, and a mismatch names both declarations: the parameter’s and the member’s. Binding $session without a configured session identity, naming a member the handle does not have, naming one two members share, binding a type that does not match, or configuring a handle with no <handle> type to read from are all build failures at the argMapping pair.
Under tenant fan-out each @service call sees its own tenant’s handle. A @condition that reads $session is not supported on a @tenantFanOut field or in a subtree projected under one, because a fanned statement is built before any tenant’s connection exists, so there is no handle to read; the build fails naming both coordinates. Bind the value in a @service there instead. A session-reading condition also cannot be used in the filter of a multi-table interface or union field, whose per-participant statements are built without it.
The tenant slot
In a build that configures <tenantColumn>, the ConnectionKey your source receives carries the tenant: key.tenant() is an Optional of the tenant column’s Java type holding the routed tenant, or Optional.empty() for the connection that serves global tables. Graphitron asks the source once per key, so the identity you set is per connection and tenant; choose the tenant’s pool from the key, and refuse a tenant the caller may not touch with KeyNotPermitted. See How-to: Tenant scoping.
What a lease must be
A lease’s connection must be in autocommit: each mutation field’s transaction opens from it, and state set inside an open transaction would be reverted by the first rollback. Graphitron refuses a lease with autocommit off as a failed acquisition, releasing it first. At release, graphitron rolls back any transaction the request left open before it calls your release, and a connection it had to stop (a fan-out worker past its deadline, a connection it could not settle) is aborted through JDBC before your release runs, so a release that finds the connection closed has nothing to clean up.
What this asks of your mount is that identity be session-scoped in your database’s own vocabulary, session GUCs on Postgres, a session or global application context on Oracle. Transaction-scoped storage will not work, and will not work from the first query rather than failing later: set_config(…, true) and SET LOCAL revert at the end of the statement that set them, and rows in an ON COMMIT DELETE ROWS temp table are deleted by the mount’s own implicit commit. One deployment requirement follows: put graphitron in front of a pool that hands out sessions, not a transaction-pooling proxy such as pgbouncer in transaction mode, which resets session state between transactions and would leave your identity on a backend nobody reads.
What ConnectionSources.mounting does for you
It switches autocommit on before your mount, first rolling back any transaction the connection arrived with, so work left open on it is discarded rather than committed under your request. A throwing mount evicts the connection rather than returning it to the pool, and fails the whole request before any of your query’s SQL runs.
On PostgreSQL it ends every release with a reset, after your unmount. It is a backstop, not a replacement: your unmount still runs first and should still clear what your mount set. What the reset buys is that a mistake there, such as an unmount written with set_config(…, true) that clears nothing, leaves the next borrower with no identity rather than with yours. Every custom variable (a dotted name such as app.user_id) is cleared. Every built-in setting (search_path, statement_timeout, the default transaction isolation and read-only mode, and the like) goes back to the value it had before your mount ran, so what your pool configures on each new connection survives. Two kinds of setting do not survive past a connection’s first request: a custom variable your pool sets with SQL after connecting (HikariCP’s connectionInitSql, Agroal’s initialSql, Quarkus’s new-connection-sql), and a setting only a superuser may change. Set those at connect time instead: in the connection properties (pgjdbc’s options=-c app.region=eu) or on the role (ALTER ROLE app_user SET app.region = 'eu'). To know what to put back, the source reads the connection’s settings each time it takes one from the pool: one extra query per request. The reset does not touch the role, so an unmount must undo a SET ROLE its mount made with RESET ROLE itself. If the unmount or the reset throws, the connection is evicted instead of returned to the pool.
If the database ended the session while the request held the connection (a session or transaction timeout, for instance), the release finds it no longer valid, evicts it without your unmount, and logs a warning; the response stands, since the session’s identity ended with it. An unmount or reset that fails on a connection that is still valid fails the request instead, because the identity on it cannot be proven cleared.
ConnectionSources.of(key → dataSource) is the same without a mount: the release returns the connection to the pool as it is.
The unmount is required
When graphitron releases a lease, the pool hands the connection to whoever asks next. That may not be a graphitron request: a health check, your own code using the same DataSource, a background job, an operation on the escape hatch. None of them mount, so they run as whatever identity the connection still carries. The unmount closes this: it runs before the connection goes back, so the next borrower always finds a connection with no identity on it. On PostgreSQL the reset backs it up, but it does not stand in for it: it leaves a role switch in place, and on other databases there is no reset at all. Clear to the value your policies treat as "no identity" (on Postgres the empty string, not NULL; see below). If your mount sets no database state, pass an unmount that does nothing.
If you have no routine at all
Setting a session variable that your RLS policies read is the same shape, written out:
var source = ConnectionSources.mounting(key -> dataSource,
(connection, key) -> DSL.using(connection).execute("select set_config('app.tenant', ?, false)", tenantId),
(connection, key) -> DSL.using(connection).execute("select set_config('app.tenant', '', false)"));
Note what the unmount clears to: the empty string, not NULL. Postgres cannot restore a touched session variable to unset, so a policy that distinguishes "never set" from "cleared" would silently diverge between a fresh connection and a recycled one. Your RLS policies must treat both NULL and the empty string as "no identity" to stay fail-closed, for example with NULLIF(current_setting('app.tenant', true), '') IS NULL.
Be aware of what this does and does not give you. A session variable is a convention: any SQL running on that connection can overwrite it, including a @service method of your own. If you need identity that consumer code on the same connection cannot forge, mount it with a definer-rights routine, or pass a signed token your mount verifies in the database. That choice is yours to make and graphitron cannot check it for you, which is why it is explained in the security guide rather than warned about at build time.
Migrating
From SessionState: build a ConnectionSource with ConnectionSources.mounting(key → dataSource, mount, unmount) (in a <tenantColumn> build ConnectionSources.mounting(key → dataSource, tenants, mount, unmount), naming the tenants the request may span), where the mount takes the connection and the key in place of the MountedSession (wrap the connection with DSL.using(connection, dialect) where you used s.configuration(), and read the tenant from key.tenant() where you used s.tenant()), and pass it to Graphitron.newOwnedExecutionInput(source, …) in place of the state. The runtime no longer holds a DataSource: build it with Graphitron.runtime(dialect) or Graphitron.runtime(dialect, settings), and choose the pool in your source. The facade’s sessionMountFailure is now requestRejection, which answers what rejected the request: your source’s own exception for a failed acquisition, the rejection itself for a failed voucher check.
From <mount> and <unmount>: the earlier form named static methods in the POM. It is retired: a leftover <mount> or <unmount> fails the build with a message pointing here. Move the body of each method into the mount and unmount of ConnectionSources.mounting, and name the old return type in <handle>.
In the dev tools
The MCP execute tool builds its own request on one dev connection, so it needs a way to make a ConnectionSource from the dev claims. When <sessionState> is configured, name a public static method that takes the claims string and a DataSource over the dev connection and returns the generated ConnectionSource in <devDatabase><session>fqcn#method</session> (or GRAPHITRON_DEV_SESSION); it is resolved against your compiled classes. Without one, the tool leases the dev connection as it is.
Transactional outbox
The <outbox> block says where the messages of every @outbox field go. A schema with an @outbox field and no <outbox> block fails the build, naming the field.
<outbox>
<table>outbox</table>
<columns>
<type>event_type</type>
</columns>
<payload>operation: $scope.operationName</payload>
</outbox>
-
<table>names an outbox table in your jOOQ catalog. Graphitron inserts one row per message and fills two columns:type, the event, andpayload. Every other column is the database’s to fill, which is where the event’s id and the time it occurred come from:CREATE TABLE outbox ( id uuid NOT NULL DEFAULT gen_random_uuid() PRIMARY KEY, type varchar(255) NOT NULL, payload jsonb NOT NULL, occurred_at timestamptz NOT NULL DEFAULT now() );<columns>mapstypeorpayloadto another column name (<type>event_type</type>); no other role exists. The build fails when the table, thetypecolumn or thepayloadcolumn is missing, whenpayloadis not a JSON, JSONB or text column, when the table has no primary key (a consumer drops a message delivered twice by its id), or when aNOT NULLcolumn graphitron does not fill has no default, naming the column. A JSON or JSONB column takes the payload as JSON; a text column takes it rendered as text. -
<function>names a procedure or a function in your jOOQ catalog that graphitron calls once per message, inside the write’s transaction and in directive order. It must be a routine the catalog has no table for (not a table-valued function), with two parameters:type, text, andpayload, JSON, JSONB or text. A parameter answers to a role by the name<parameters>binds the role to (<type>p_type</type>), else by the role’s own name, underscores and case aside. The routine gives the event its id and anything else it records. Any value it returns is discarded. The build fails when the name matches no such routine, or two. A routine that is a function with no return value is a procedure here. -
<payload>is an argMapping every message carries, for what belongs on every event. It reads$scopesources and$session.<member>; arguments and$resultbelong to a field and are not available there. A$sessionentry here makes every@outboxmessage read the handle, so no message can be written on a caller-suppliedDSLContext. A<payload>that does not parse, an entry missing its colon say, fails the build as the configuration is read, naming where the parse stopped.
Name exactly one of <table> and <function>. A block naming both, or neither, is reported at every @outbox it affects.
An @outbox(on: ERROR) message goes to the same target, with the same common payload, but not in the field’s transaction: it is written after that transaction rolled back, in a transaction of its own (see On failure). How long graphitron waits for a fresh connection to write one on is a runtime setting, withOutboxAcquisitionTimeout, not a plugin one.
The non-emitting goals' package sentinel
The validate and capture goals exist so consumers can run mvn graphitron:validate or mvn graphitron:capture from the command line without editing their POM’s <execution> block to thread <outputPackage> / <jooqPackage>. The mojo substitutes an inert sentinel (validation.unused) for both packages when they are not configured, so the run context’s non-null contract holds. The sentinel never reaches generated code; neither goal emits anything.
capture never fails over the schema it read. It fills the store and stops, and what the schema’s own stages made of the document is recorded there as rows rather than reported as a build failure, because a broken schema is exactly when a store is wanted for debugging it. It fails only when it cannot capture at all, for example when the store cannot be opened.
If the parameters are configured (e.g. when validate is bound to the validate lifecycle phase alongside a generate execution), the configured values flow through normally; the sentinel only activates when the parameters are absent.
A sentinel <jooqPackage> resolves to no catalog at all, and both goals log a warning saying so. For capture the consequence is worth stating twice, which is why the goal warns a second time in its own words: the store it leaves behind holds the graph with no tables, columns or keys behind it, and a reader asking the store about the database gets nothing rather than an error.
Putting it together
The canonical generate-and-deploy <execution> against the example schema:
<plugin>
<groupId>no.sikt</groupId>
<artifactId>graphitron-maven-plugin</artifactId>
<version>${graphitron.version}</version>
<executions>
<execution>
<id>rewrite-generate</id>
<goals><goal>generate</goal></goals>
<configuration>
<schemaInputs>
<schemaInput>
<pattern>src/main/resources/graphql/schema.graphqls</pattern>
</schemaInput>
</schemaInputs>
<jooqPackage>com.example.jooq</jooqPackage>
<outputPackage>com.example.generated</outputPackage>
</configuration>
</execution>
</executions>
</plugin>
For the dev loop add a second execution bound to no phase, or invoke mvn graphitron:dev directly. graphitron-sakila-example’s pre-wired POM (`graphitron-sakila-example/pom.xml) is the canonical worked example.
Codegen classpath
The reflection sites that resolve consumer-declared classes (@service / @externalField target classes, the classes a type’s backing record is reflected from off its producing field, @condition resolvers, the generated jOOQ DefaultCatalog) load from the project’s compile classpath plus every reactor sibling’s target/classes, not from the plugin realm. A reactor sibling is read from its own output, target/classes or else its jar in target, in the place Maven put it on the classpath, rather than from the copy Maven resolved, which for a module not built in this run is the one installed in the local repository. Any artifact declared as a normal <dependency> of the consumer module is visible to the generator at codegen time. A class an author names in the schema must come from that declared set: the generator rejects a schema naming a class that reaches the classpath only transitively or only through a <plugin><dependencies> block, naming the coordinate to declare; see Make the class nameable. Do not mirror service or catalog jars under <plugin><dependencies>; that route is withdrawn.
The codegen classloader is layered over the plugin’s own: delegation is parent-first, so every org.jooq class graphitron’s jOOQ (org.jooq:jooq, the version the plugin was built against) carries is loaded from graphitron’s copy, and only the classes it lacks come from your jars. That is what lets the generator read your generated catalog through its own jOOQ interfaces. It has a current limitation on a commercial jOOQ edition: a class graphitron reflects (a @service, @condition or @externalField class, a <sessionState> mount or unmount class) must not name an edition-only jOOQ type, such as a UDT array record, in any of its method signatures, not only the one graphitron calls, because reading one method resolves the types of all of them. The build names the class and the type when one does; move such helpers into a nested or separate class. The plugin classloader itself must hold exactly the jOOQ graphitron was built against: a <plugin><dependencies> entry that brings a second jOOQ, or replaces it with another version, fails every goal before anything runs, naming the jar and the entry that brought it, or the candidate entries when Maven does not record which one did.
Drift protection
A bidirectional coverage test (MojoDocCoverageTest in graphitron-maven-plugin) asserts every @Parameter-annotated field on AbstractRewriteMojo, GenerateMojo, ValidateMojo, and DevMojo has a row in this page’s parameter tables, and every parameter row corresponds to an annotated field on one of those Mojos. A new @Parameter field cannot land green without a doc row; a removed field forces the row’s removal.
The same test also pins which heading each row sits under against the goals that declare the parameter, because presence in the wrong table is still wrong: this page says the shared parameters apply to every goal, so a dev-only parameter listed among them tells you to configure something three goals ignore. Moving a parameter between Mojos therefore forces its row to move too, and a parameter table added under a heading the test does not know the goal scope of fails rather than going unchecked.
See also
-
Runtime API reference covers the
Graphitronfacade andGraphitronContextinterface this plugin’sgenerategoal emits into the consumer module. -
Directive reference covers the SDL surface every
<schemaInput>parses against, including the four directives that take external Java code throughExternalCodeReference. -
Tutorial page 1: Prerequisites is the first place a consumer meets the plugin and the example consumer’s pre-wired POM.