Skip to content

Maven Central pilot: licence, Central's POM metadata, the licence check, publishing - #29

Draft
adamjohnwright wants to merge 12 commits into
mainfrom
central/pilot
Draft

adamjohnwright wants to merge 12 commits into
mainfrom
central/pilot

Conversation

@adamjohnwright

@adamjohnwright adamjohnwright commented Nov 23, 2026 •

Copy link
Copy Markdown

A pilot, for review; not to merge yet. It's the second half of reactome/reactome-parent#4, which explains the purpose and holds the decisions for review. This shows the pattern on the most-used library.

  • LICENSE: Apache-2.0. The POM gets <licenses> and graph-core's own <scm>; otherwise it would inherit reactome-parent's, which points at the wrong repository.
  • Parent reactome-parent 1.0.7, the pilot's. The build turns on its dependency licence check. graph-core's 35 shipped dependencies all pass: Apache, MIT, BSD and EPL, plus four under a choice of licences, each passing on its permissive option. Seen failing with EPL removed.
  • The POM put in tidy's order, which the parent checks: elements reordered and blank lines added, nothing else.
  • .github/workflows/maven.yml: graph-core had no CI.
    • Every PR: built and packaged (the jar, the sources jar and the javadoc jar), with the licence check.
    • A v* tag: signed and uploaded to the Central Portal, behind the maven-central environment.
    • Temporary: a step builds reactome-parent 1.0.7 from its pilot branch first, until 1.0.7 is published.
    • Not run yet: graph-core's tests. They need a Neo4j graph of Reactome's data. Running them against a fixture graph is the next step, and the start of testing a change against everything that depends on it.
  • Checked: from an empty Maven repository with no EBI, mvn verify builds the three jars and passes the licence check. reactome-base, the MySQL-era library, is test-scoped here, so it isn't shipped.
  • For review: graph-core still lists EBI's repositories and an http:// BioPAX one. The version stays 3.0.0-SNAPSHOT, and the release version is the maintainers' choice (reactome-parent's decision A).

Added 25 Nov: builds under the strict parent

  • javac lints the code. AspectJ used to compile the sources itself, so javac had nothing to compile and nothing to check. Now javac compiles, and dev.aspectj's plugin weaves the compiled classes, main and test. It's the same 684 join points as before, the same advice order, and the jar's resources are unchanged.
  • Zero warnings under -Xlint:all,-path (it was 232):
    • generics fixed, keeping the erased signatures;
    • narrow, commented @SuppressWarnings only where a public method is inherently unchecked (the caller picks T);
    • every domain class has a serialVersionUID.
  • javadoc passes doclint.
  • Formatted with palantir-java-format in one formatting-only commit (7b6e55f), listed in .git-blame-ignore-revs.
  • Fixed:
    • ReflectionUtils filled static fields too. It would have printed serialVersionUID to stderr for every Person built. Now covered by a test, seen failing.
    • CRUDRepository.query(String, Map, Class<T>) threw on every call. It now returns the template's mapped result; not yet tried against a graph.
  • CI compiles, lints and weaves every test, and runs those that need no graph.
  • Dependabot added.

For downstream code:

  • DatabaseObjectUtils.getClassForName, SchemaNode.getClazz() and AttributeClass.getType() now return Class<?>, not raw Class. Binaries built against the old jar still work. But source that assigns one straight to Class<? extends X> must add a cast or asSubclass when it recompiles.
  • Objects Java-serialised by an older jar won't deserialise, because of the new serialVersionUID.

Merge with a merge commit, not squash or rebase, or .git-blame-ignore-revs names a commit that isn't on main.

Open PRs (#17, #20, #21, #25, #26) will conflict with the formatting commit. The easy way through: on the PR's branch, first merge the commit just before 7b6e55f, then run mvn spotless:apply and commit. Then merge main: both sides are formatted the same way, so only real changes conflict.

Not yet run: the tests that need a Reactome graph. They're next: a fixture slice in a Neo4j container on every PR, and the full release graph weekly.

Added 26 Nov: aspects woven once

AspectJ wove target/classes and target/test-classes in place, so a build without clean wove classes that were already woven. Advised methods gained a second closure (271 → 421 in the main classes, 218 → 436 in the tests), and their advice, such as the logging aspect's, ran twice per call. This was also true before this branch.

  • javac now writes target/unwoven-classes and target/unwoven-test-classes, and AspectJ weaves from there into target/classes and target/test-classes.
  • CI builds a second time without clean and fails if either closure count changes. It fails with the old layout, and with only the test weave put back in place.
  • Against a clean build of the previous commit, the woven classes are the same. The one difference is the order of a synthetic method in LazyFetchAspect, which ajc varies from run to run anyway.
  • The jar no longer ships builddef.lst, the weaver's arguments, which include the build machine's paths.

🤖 Generated with Claude Code

…ck, publishing

- LICENSE: Apache-2.0; <licenses> and graph-core's own <scm> in the POM.
- The parent is reactome-parent 1.0.7 (its pilot branch), whose licence check
  the build turns on; the POM put in tidy's order, which the parent checks.
- .github/workflows/maven.yml: built, packaged and its licences checked on every
  pull request (its tests need a Reactome graph: next step); on a v* tag signed
  and uploaded to the Central Portal behind the maven-central environment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adamjohnwright and others added 7 commits November 25, 2026 19:42
…lasses

AspectJ compiled the sources itself, so javac had nothing to compile and its
lint never ran. javac now compiles with -Xlint:all (but path), and the
maintained AspectJ plugin weaves the compiled classes, main and test: the same
684 join points as before. Every domain class gets a serialVersionUID, and
ReflectionUtils no longer treats a class's constants as fields to fill (it
printed the refusal for every object built); a test, seen failing without it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 120 rawtypes, unchecked, redundant-cast and deprecation warnings are gone,
with no change in behaviour and the same erased signatures:

- raw Class, Collection, Iterator and List become Class<?> (or Class<T> where
  the method already has a T), Collection<?>, Iterator<SchemaNode>; the public
  methods keep their names, parameters and erased descriptors
- where the caller picks T (getByClassName, fetchSingleValue, getObject, the
  repositories' find methods), the cast stays and an @SuppressWarnings
  ("unchecked") on the smallest method or local says why
- PersonService's eight casts to the type already returned are dropped
- AdvancedLinkageService loses a private field of the deprecated
  AdvancedLinkageRepository that was never set or read
- tests: SerializationTest reads maps through a TypeReference, the test
  factory builds through getDeclaredConstructor().newInstance() with the same
  outcome for each failure, and the tests of deprecated methods say so

Compared with javap against this commit's parent, only DatabaseObjectUtils
(one extra local for the suppressed cast) and AdvancedLinkageService (the
field) differ, beyond AspectJ's line numbers and member order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Inherits the parent's compiler settings (any warning fails the build) and adds
-proc:none: no processor is used, and log4j's warned on every compile. The
JetBrains annotations, compile-only, so a dependency's @contract no longer
warns. One maven-source-plugin declaration, not two. javadoc's doclint: the
authors' addresses escaped, one empty paragraph gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Formatting only (mvn spotless:apply): no other change. The woven join points
are the same 684.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… can

query(String, Map, Class<T>) cast the client's fetch specification itself to
T and threw on every call; it now returns the template's mapped result. CI
built with -Dmaven.test.skip, which skips compiling the tests too: now every
test is compiled, linted and woven, and those needing no graph run. The test
plugins' --illegal-access=permit, which Java 17 ignores, is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright

Copy link
Copy Markdown
Author

Behaviour compared, old jar against new. Built at 2b64ddf, before the strict work, and at 45f7107. One program was run against each jar and the outputs diffed:

  • graph-importer's view: for all 113 model classes, the fields it copies (@Relationship / @ReactomeProperty, in declaration order up the hierarchy). Identical, so the graph it writes, Person nodes included, is unchanged.
  • JSON: Jackson's output for every model class that can be created (88), with its simple fields set. Identical. serialVersionUID is static and never written.
  • ReflectionUtils.build: the Person, Species and Pathway, and the DiagramResult and DiagramOccurrences, built from the same sample row. The same field values, and nothing printed to stderr.

The comparison can see a difference. With the old ReflectionUtils put into the new jar, it shows serialVersionUID printed to stderr for each Person, Species and Pathway built. The values built are the same. That noise is the only effect the static-field skip removes.

Behaviour that does change:

  • CRUDRepository.query(String, Map, Class<T>) threw on every call and now returns the mapped object. Not yet run against a graph; that needs the fixture-graph step.
  • Objects Java-serialised by an older jar won't deserialise.

🤖 Generated with Claude Code

adamjohnwright and others added 2 commits November 26, 2026 14:39
AspectJ wove target/classes in place, so a build without clean wove classes that
were already woven: 150 advised methods gained a second closure, and the logging
advice ran twice for each service call. javac now writes target/unwoven-classes
(and unwoven-test-classes), and AspectJ weaves from there into target/classes.

Checked: a clean build gives the same 271 closures as before; a second build
without clean leaves target/classes byte-identical; against the clean build
before this change, only builddef.lst (the weaver's arguments) and the order of
one synthetic method in LazyFetchAspect differ. CI now builds a second time
without clean and fails if the closure count changes: it fails without this
change (271, then 421) and passes with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…f the jar

From the adversarial review of c30c91e:
- Test classes were woven twice as well (218 closures, then 436). The CI check now
  compares main and test counts; with only the test weave put back in place it
  fails (271 218, then 271 436), and passes with this branch.
- The jar shipped builddef.lst, the weaver's arguments with the build machine's
  paths; it is now excluded.
- Correction to c30c91e's message: a rebuild is not byte-identical. ajc orders
  one synthetic method of LazyFetchAspect differently from run to run (members
  and closures are the same); that was so before this branch too.
- Not changed: classes of a deleted source stay until a clean build, as before;
  the release job builds from a fresh checkout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright

Copy link
Copy Markdown
Author

Same answers as main: graph-core's own test suite, run against a Reactome release 98 graph

The whole suite ran twice against the same graph: once at main (62aef35, the build the exporters pin today) and once at this branch (d7dffbb).

main this branch
Tests 183 184 (ReflectionUtilsTest is new)
Pass 159 160
Fail 24 24
  • Every test common to both runs had the same outcome. The 24 that fail are the same tests on both sides, with the same messages.
  • The 24 failures:
    • 6 need the MySQL (relational) database, which wasn't connected: GeneralServiceTest's version and name checks, UpdateTrackerServiceTest, and the DatabaseObjectFactory comparisons.
    • The rest assert values from an earlier release's data: counts, top-level pathways, diagram occurrences and the like.
    • They fail on main too, so they are not caused by this branch. Updating them is separate work.
  • One change to make the run possible, applied the same way to both, in a copy, not committed: every test's setup calls DatabaseObjectFactory.clearCache(), which needs MySQL. It was made to do nothing when MySQL isn't connected. Without that change every test errors before reaching the graph.
  • What this doesn't cover: the repositories that build on graph-core. Those come next.

🤖 Generated with Claude Code

@adamjohnwright

Copy link
Copy Markdown
Author

The repositories that build on graph-core, built against main and against this branch

Each was built twice from its default branch: once with graph-core main (62aef35), once with this branch (d7dffbb). Each graph-core build was installed under its own version, and every dependent's graph-core dependency was pinned to it, the same way on both sides. No database was connected.

Dependent Compiles (main / this branch) Tests Outcome, both sides
sbml-exporter yes / yes 59 59 pass
BioPAX3Exporter yes / yes 98 98 pass
data-export yes / yes 5 5 pass
analysis-core yes / yes 1 1 pass
interaction-exporter yes / yes 2 2 error: no graph configured
search-indexer yes / yes 1 1 error: no graph configured
apicuron-exporter yes / yes 4 4 error: no database name
analysis-service yes / yes 40 40 error: an unfilled logging placeholder
graph-qa, diagram-converter, graph-importer yes / yes none —
interaction-importer not built — its snapshot dependencies are no longer on EBI's Nexus
  • No test outcome differs between the two sides. Where tests errored, the causes were identical and have nothing to do with graph-core.
  • Every dependent that resolves its dependencies compiles against this branch, so nothing they call has changed signature.
  • Limits:
    • Only four dependents have tests that run without a database.
    • Three have no tests, so for them only compilation was checked.
    • interaction-exporter needed verifier-lib 1.0.0 in place of a broken local 1.0-SNAPSHOT, set the same on both sides.
  • Testing the dependents' output against a shared fixture graph is the next step, for the dependency-tree pipeline.

🤖 Generated with Claude Code

adamjohnwright and others added 2 commits November 26, 2026 16:58
graph-core's POM on Central stays there, and its repositories with it. EBI's Nexus is
going away, and the BioPAX repository was plain http, which Maven refuses anyway, so
the POM names none: everything graph-core needs is on Central. A build check fails if
the POM names a repository again.

The developers are the current maintainers.

Built and verified (tidy, licences, the test that needs no graph) with an empty local
repository: every artifact came from Central, the parent from reactome-parent's pilot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n published

As reactome-parent's review found for its POMs: the SCM addresses were not URLs
(ssh://github.com:...) or used git://, which GitHub no longer serves. checkout and
setup-java are pinned to their release commits, since the publish job holds the
signing key and the Central token. The publish job stops unless the tag is on main,
is v<the POM's version>, and that version is not a SNAPSHOT (each refusal seen, and a
matching tag on main seen passing).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant