Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 8 additions & 1 deletion docs/guide/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ You don't have to install Chromium's `depot_tools`, Siso or GN: the build clones
| Tool | Notes |
| --------------------- | ----------------------------------------------------------------------------------------- |
| JDK 17 or newer | The libraries target Java 11, and the examples need 17. |
| Maven 3.6.3 or newer | |
| Maven 3.9.6 or newer | Needed by the native builds' CMake plugin. The build checks it, and the JDK, first. |
| Git | Clones `depot_tools`, the WebRTC sources and the submodules. |
| CMake 3.13 or newer | Must be on the `PATH`. The Maven build does not download it. |
| Python 3 | Runs `depot_tools` and the Linux sysroot script. On macOS it also needs `setuptools`. |
Expand Down Expand Up @@ -134,6 +134,13 @@ it as `deployment-bundle-dry-run`. It pushes no commits or tags, dispatches no
publication workflow, and uses placeholder Central credentials with uploads
disabled.

The jars are reproducible: every entry and the manifest's `Build-Date` carry
`project.build.outputTimestamp` from the root pom instead of the time of the
build, so the same commit builds into the same Java jars. Release preparation
sets it to the time of the release commit and again for the next development
version; it needs no manual change. The native library jars are not covered,
since CMake and the compilers do not build byte for byte the same libraries.

If preparation pushed the tag but dispatch failed, start Publish release manually
and select that tag. Before retrying a failed publication, check whether Maven
Central already accepted the version; published releases cannot be overwritten.
Expand Down
47 changes: 44 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,12 @@
</scm>

<properties>
<timestamp>${maven.build.timestamp}</timestamp>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
<!-- The time every jar entry and the jars' Build-Date carry, so that the
same sources build into the same jars. release:prepare sets it to
the time of the release commit and again for the next development
version; snapshots keep the time of the last release. -->
<project.build.outputTimestamp>2026-10-16T19:14:36Z</project.build.outputTimestamp>
</properties>

<modules>
Expand Down Expand Up @@ -88,6 +91,11 @@
<fork>true</fork>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
Expand All @@ -107,6 +115,35 @@
<artifactId>maven-deploy-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.6.3</version>
<executions>
<execution>
<id>enforce-build-environment</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<!-- The cmake-maven-plugin of the native builds needs 3.9.6,
the central-publishing-maven-plugin 3.9.2. -->
<requireMavenVersion>
<version>[3.9.6,)</version>
</requireMavenVersion>
<!-- The libraries target Java 11, but the examples need 17. -->
<requireJavaVersion>
<version>[17,)</version>
</requireJavaVersion>
<requirePluginVersions>
<message>Give every plugin a version in the root pom's pluginManagement.</message>
</requirePluginVersions>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
Expand Down Expand Up @@ -146,7 +183,7 @@
<compress>true</compress>
<manifestEntries>
<Version>${project.version}</Version>
<Build-Date>${maven.build.timestamp}</Build-Date>
<Build-Date>${project.build.outputTimestamp}</Build-Date>
</manifestEntries>
</archive>
<skipIfEmpty>true</skipIfEmpty>
Expand Down Expand Up @@ -220,6 +257,10 @@
</pluginManagement>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down
45 changes: 20 additions & 25 deletions webrtc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,24 @@

<name>webrtc-java</name>

<properties>
<!-- The JVM arguments of every test run, the jni-check profile's
included. add-modules and add-reads: see the test compilation
below. add-exports: dev.onvoid.webrtc.internal is not exported to
applications, but the tests cover NativeApi, which native extension
modules use to reach the native sources. -->
<webrtc.test.argLine>
--add-modules java.desktop
--add-reads webrtc.java=java.desktop
--add-exports webrtc.java/dev.onvoid.webrtc.internal=ALL-UNNAMED
--add-opens webrtc.java/dev.onvoid.webrtc=ALL-UNNAMED
--add-opens webrtc.java/dev.onvoid.webrtc.logging=ALL-UNNAMED
--add-opens webrtc.java/dev.onvoid.webrtc.media=ALL-UNNAMED
--add-opens webrtc.java/dev.onvoid.webrtc.media.audio=ALL-UNNAMED
--add-opens webrtc.java/dev.onvoid.webrtc.media.video=ALL-UNNAMED
</webrtc.test.argLine>
</properties>

<build>
<plugins>
<!-- The module does not read java.desktop, but a desktop capture test
Expand All @@ -37,20 +55,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- add-exports: dev.onvoid.webrtc.internal is not exported to
applications, but the tests cover NativeApi, which native
extension modules use to reach the native sources.
add-reads: see the test compilation above. -->
<argLine>
--add-modules java.desktop
--add-reads webrtc.java=java.desktop
--add-exports webrtc.java/dev.onvoid.webrtc.internal=ALL-UNNAMED
--add-opens webrtc.java/dev.onvoid.webrtc=ALL-UNNAMED
--add-opens webrtc.java/dev.onvoid.webrtc.logging=ALL-UNNAMED
--add-opens webrtc.java/dev.onvoid.webrtc.media=ALL-UNNAMED
--add-opens webrtc.java/dev.onvoid.webrtc.media.audio=ALL-UNNAMED
--add-opens webrtc.java/dev.onvoid.webrtc.media.video=ALL-UNNAMED
</argLine>
<argLine>${webrtc.test.argLine}</argLine>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -93,17 +98,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory" />
<argLine>
-Xcheck:jni
--add-modules java.desktop
--add-reads webrtc.java=java.desktop
--add-exports webrtc.java/dev.onvoid.webrtc.internal=ALL-UNNAMED
--add-opens webrtc.java/dev.onvoid.webrtc=ALL-UNNAMED
--add-opens webrtc.java/dev.onvoid.webrtc.logging=ALL-UNNAMED
--add-opens webrtc.java/dev.onvoid.webrtc.media=ALL-UNNAMED
--add-opens webrtc.java/dev.onvoid.webrtc.media.audio=ALL-UNNAMED
--add-opens webrtc.java/dev.onvoid.webrtc.media.video=ALL-UNNAMED
</argLine>
<argLine>-Xcheck:jni ${webrtc.test.argLine}</argLine>
</configuration>
</plugin>
</plugins>
Expand Down
Loading