Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c04ad9e
Add Java Platform Module System (JPMS) support
cowwoc Sep 21, 2025
ad1f8d1
Fix JPMS split package violations and enable documentation generation
cowwoc Sep 22, 2025
2659b4f
Update copyright year to 2025 for newly created file
cowwoc Sep 22, 2025
b78c9a0
Make module-info compilation CI-safe
cowwoc Sep 22, 2025
8aead27
Restore package documentation for proto extensions
cowwoc Sep 22, 2025
5760bfd
Update core/src/main/java/module-info.java
cowwoc Sep 24, 2025
6585167
Fix module-info setup and GWT compatibility issues
cpovirk May 15, 2026
7db6fde
Merge remote-tracking branch 'origin/master' into add-module-info
cpovirk May 15, 2026
28162cb
Remove unnecessary java.compiler requirement from module-info.java
cpovirk May 15, 2026
461d266
test under 25 instead of 11, use 999.0.0-SNAPSHOT throughout instead …
cpovirk May 15, 2026
4121459
Restore Employee sample extension and fix modular test visibility
cpovirk May 15, 2026
575a6ac
document add-exports
cpovirk May 15, 2026
3c8e545
remove autovalue annotations from module
cpovirk May 15, 2026
4136d0f
Move modular build configuration and GWT exclusions to core/pom.xml
cpovirk May 15, 2026
80455f7
restore comment about why add-exports
cpovirk May 15, 2026
c9496fc
add transitive for junit, where it is probably important for users of…
cpovirk May 15, 2026
caacd60
transitive for guava, too
cpovirk May 15, 2026
4319994
use java 26 for builds
cpovirk May 15, 2026
eb00006
pin artifacts
cpovirk May 15, 2026
1b70d3a
Fix CI failure by moving modular compilation to a JDK 9+ profile
cpovirk May 15, 2026
fd02f03
Skip main compilation in CI test job to preserve build artifacts
cpovirk May 15, 2026
bd6d3a1
Unpack build artifacts in CI test job to satisfy test-compilation
cpovirk May 15, 2026
0b7ad32
Merge branch 'master' into add-module-info
cpovirk May 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,23 @@
</path>
</annotationProcessorPaths>
</configuration>
<executions>
<execution>
<id>compile-java9</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>9</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
<useIncrementalCompilation>false</useIncrementalCompilation>
Comment thread
cowwoc marked this conversation as resolved.
Outdated
<moduleVersion>1.0</moduleVersion>
Comment thread
cowwoc marked this conversation as resolved.
Outdated
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
Expand All @@ -110,6 +127,13 @@
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Multi-Release>true</Multi-Release>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the current configuration, I don't think we actually end up producing a multi-release jar, so I think we can get by without this.

</manifestEntries>
</archive>
</configuration>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error #2 from mvn clean install:

[INFO] Running com.google.common.truth.CorrespondenceExceptionStoreTest
[ERROR] Tests run: 6, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.009 s <<< FAILURE! -- in com.google.common.truth.CorrespondenceExceptionStoreTest
[ERROR] com.google.common.truth.CorrespondenceExceptionStoreTest.describeAsMainCause_notEmpty -- Time elapsed: 0.007 s <<< FAILURE!
value of:
    getValue()
expected to match:
    compare\(null, 123\) threw com.google.common.truth.TestCorrespondences\$NullPointerExceptionFromWithin10Of\s+at com\.google\.common\.truth\.TestCorrespondences(.|\n)*\n---
but was:
    compare(null, 123) threw com.google.common.truth.TestCorrespondences$NullPointerExceptionFromWithin10Of
        at com.google.truth@999.0.0-SNAPSHOT/com.google.common.truth.TestCorrespondences.lambda$static$1(TestCorrespondences.java:76)
        at com.google.truth@999.0.0-SNAPSHOT/com.google.common.truth.Correspondence$FromBinaryPredicate.compare(Correspondence.java:150)
        at com.google.truth@999.0.0-SNAPSHOT/com.google.common.truth.Correspondence$FormattingDiffs.compare(Correspondence.java:453)
    
    ---
        at com.google.truth@999.0.0-SNAPSHOT/com.google.common.truth.CorrespondenceExceptionStoreTest.assertExpectedFacts(CorrespondenceExceptionStoreTest.java:99)
        at com.google.truth@999.0.0-SNAPSHOT/com.google.common.truth.CorrespondenceExceptionStoreTest.describeAsMainCause_notEmpty(CorrespondenceExceptionStoreTest.java:58)
 
[ERROR] com.google.common.truth.CorrespondenceExceptionStoreTest.describeAsAdditionalInfo_notEmpty -- Time elapsed: 0.002 s <<< FAILURE!
value of:
    getValue()
expected to match:
    compare\(null, 123\) threw com.google.common.truth.TestCorrespondences\$NullPointerExceptionFromWithin10Of\s+at com\.google\.common\.truth\.TestCorrespondences(.|\n)*\n---
but was:
    compare(null, 123) threw com.google.common.truth.TestCorrespondences$NullPointerExceptionFromWithin10Of
        at com.google.truth@999.0.0-SNAPSHOT/com.google.common.truth.TestCorrespondences.lambda$static$1(TestCorrespondences.java:76)
        at com.google.truth@999.0.0-SNAPSHOT/com.google.common.truth.Correspondence$FromBinaryPredicate.compare(Correspondence.java:150)
        at com.google.truth@999.0.0-SNAPSHOT/com.google.common.truth.Correspondence$FormattingDiffs.compare(Correspondence.java:453)
    
    ---
        at com.google.truth@999.0.0-SNAPSHOT/com.google.common.truth.CorrespondenceExceptionStoreTest.assertExpectedFacts(CorrespondenceExceptionStoreTest.java:99)
        at com.google.truth@999.0.0-SNAPSHOT/com.google.common.truth.CorrespondenceExceptionStoreTest.describeAsAdditionalInfo_notEmpty(CorrespondenceExceptionStoreTest.java:73)
 

That should just be a matter of loosening the assertion to accept either style.

Of course, another option for this (and for Error #1) is to see if we can keep maven-surefire-plugin out of "modules mode" for its testing. Having the modular mode set up is nice if it's straightforward, but I don't want you to feel like you need to block the user-facing improvements you need on an internal build improvement, albeit one that might someday help us catch modules-related bugs before you encounter them.

<executions>
<execution>
<id>attach-gwt-sources</id>
Expand Down
27 changes: 27 additions & 0 deletions core/src/main/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (c) 2024 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

module com.google.truth {
requires com.google.common;
requires junit;

requires static org.jspecify;
requires static com.google.errorprone.annotations;
requires static org.objectweb.asm;
requires static auto.value.annotations;

exports com.google.common.truth;
}
25 changes: 25 additions & 0 deletions extensions/liteproto/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,31 @@
</path>
</annotationProcessorPaths>
</configuration>
<executions>
Comment thread
cowwoc marked this conversation as resolved.
Outdated
<execution>
<id>compile-java9</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>9</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
</plugin>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error from mvn clean install -DskipTests:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.14.0:testCompile (default-testCompile) on project truth-liteproto-extension: Compilation failure: Compilation failure:
[ERROR] /usr/local/google/home/cpovirk/clients/truth-green/truth/extensions/liteproto/src/test/java/com/google/common/truth/extensions/liteproto/test/LiteProtoSubjectTest.java:[24,63] package com.google.common.truth.extensions.liteproto.test.proto does not exist
[ERROR] /usr/local/google/home/cpovirk/clients/truth-green/truth/extensions/liteproto/src/test/java/com/google/common/truth/extensions/liteproto/test/LiteProtoSubjectTest.java:[25,63] package com.google.common.truth.extensions.liteproto.test.proto does not exist
[ERROR] /usr/local/google/home/cpovirk/clients/truth-green/truth/extensions/liteproto/src/test/java/com/google/common/truth/extensions/liteproto/test/LiteProtoSubjectTest.java:[26,63] package com.google.common.truth.extensions.liteproto.test.proto does not exist
[ERROR] /usr/local/google/home/cpovirk/clients/truth-green/truth/extensions/liteproto/src/test/java/com/google/common/truth/extensions/liteproto/test/LiteProtoSubjectTest.java:[27,63] package com.google.common.truth.extensions.liteproto.test.proto does not exist
[ERROR] /usr/local/google/home/cpovirk/clients/truth-green/truth/extensions/liteproto/src/test/java/com/google/common/truth/extensions/liteproto/test/LiteProtoSubjectTest.java:[28,63] package com.google.common.truth.extensions.liteproto.test.proto does not exist

I haven't thought about that one, but it might be a matter of moving more stuff or updating more references. I'd encourage you not to worry about it until we discuss the proto/liteproto business more, but I'm noting it here as a record of potential remaining work.

</plugins>
</build>
Expand Down
26 changes: 26 additions & 0 deletions extensions/liteproto/src/main/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (c) 2024 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

module com.google.truth.extensions.liteproto {
requires com.google.truth;
requires com.google.common;

requires static org.jspecify;
requires static com.google.errorprone.annotations;
requires static com.google.protobuf.lite;

exports com.google.common.truth.extensions.proto;
}
25 changes: 25 additions & 0 deletions extensions/proto/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,31 @@
</path>
</annotationProcessorPaths>
</configuration>
<executions>
<execution>
<id>compile-java9</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>9</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
27 changes: 27 additions & 0 deletions extensions/proto/src/main/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (c) 2024 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

module com.google.truth.extensions.proto {
requires com.google.truth;
requires com.google.truth.extensions.liteproto;
requires com.google.common;
requires com.google.protobuf;

requires static org.jspecify;
requires static com.google.errorprone.annotations;

exports com.google.common.truth.extensions.proto;
}
28 changes: 28 additions & 0 deletions extensions/re2j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,34 @@
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>compile-java9</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>9</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
22 changes: 22 additions & 0 deletions extensions/re2j/src/main/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2024 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

module com.google.truth.extensions.re2j {
requires com.google.truth;
requires com.google.re2j;

exports com.google.common.truth.extensions.re2j;
}