Skip to content

Commit 8cd149a

Browse files
committed
build: ship LICENSE and NOTICE in every jar
Also extends the copyright to 2019-2026.
1 parent 5216168 commit 8cd149a

5 files changed

Lines changed: 67 additions & 2 deletions

File tree

‎NOTICE‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
webrtc-java
2-
Copyright 2019 Alex Andres
2+
Copyright 2019-2026 Alex Andres
33

44
EXTERNAL COMPONENTS
55

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ For more detailed information, check out the documentation:
6262

6363
## License
6464

65-
Copyright (c) 2019 Alex Andres
65+
Copyright (c) 2019-2026 Alex Andres
6666

6767
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
6868

‎pom.xml‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,23 @@
249249
<artifactId>central-publishing-maven-plugin</artifactId>
250250
</plugin>
251251
</plugins>
252+
253+
<resources>
254+
<resource>
255+
<directory>src/main/resources</directory>
256+
</resource>
257+
<!-- The project's license and notice go into every jar, where they reach
258+
those who get the library from Maven Central rather than from this
259+
repository. Every module sits directly below the root. -->
260+
<resource>
261+
<directory>${project.basedir}/..</directory>
262+
<targetPath>META-INF</targetPath>
263+
<includes>
264+
<include>LICENSE</include>
265+
<include>NOTICE</include>
266+
</includes>
267+
</resource>
268+
</resources>
252269
</build>
253270

254271
<profiles>
@@ -264,6 +281,35 @@
264281
<groupId>org.apache.maven.plugins</groupId>
265282
<artifactId>maven-javadoc-plugin</artifactId>
266283
</plugin>
284+
<!-- The javadoc jar is made of what javadoc writes, not of the resources,
285+
so the license and notice are put next to the pages before it is
286+
packed. The notice covers the parts of the API docs taken from the
287+
W3C specification. -->
288+
<plugin>
289+
<groupId>org.apache.maven.plugins</groupId>
290+
<artifactId>maven-resources-plugin</artifactId>
291+
<executions>
292+
<execution>
293+
<id>javadoc-licenses</id>
294+
<phase>prepare-package</phase>
295+
<goals>
296+
<goal>copy-resources</goal>
297+
</goals>
298+
<configuration>
299+
<outputDirectory>${project.build.directory}/reports/apidocs/META-INF</outputDirectory>
300+
<resources>
301+
<resource>
302+
<directory>${project.basedir}/..</directory>
303+
<includes>
304+
<include>LICENSE</include>
305+
<include>NOTICE</include>
306+
</includes>
307+
</resource>
308+
</resources>
309+
</configuration>
310+
</execution>
311+
</executions>
312+
</plugin>
267313
<plugin>
268314
<groupId>org.apache.maven.plugins</groupId>
269315
<artifactId>maven-gpg-plugin</artifactId>

‎webrtc-java-media/src/main/cpp/CMakeLists.txt‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,16 @@ foreach(RUNTIME_LIB ${FFMPEG_RUNTIME_LIBS})
144144
COMMENT "Collecting ${RUNTIME_LIB} for the platform jar")
145145
endforeach()
146146

147+
# The project's own license and notice go along as well, at the top of
148+
# META-INF as in the Java jars.
149+
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
150+
COMMAND ${CMAKE_COMMAND} -E make_directory "${NATIVES_DIR}/META-INF"
151+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
152+
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../LICENSE"
153+
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../NOTICE"
154+
"${NATIVES_DIR}/META-INF"
155+
COMMENT "Collecting the webrtc-java license and notice for the platform jar")
156+
147157
#
148158
# The LGPL asks for its text to travel with the FFmpeg libraries, along with
149159
# a notice saying what they are and where their source is. Both go under

‎webrtc-jni/src/main/cpp/CMakeLists.txt‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,15 @@ install(FILES
178178
COMPONENT Runtime
179179
)
180180

181+
# The project's own license and notice go along as well, at the top of
182+
# META-INF as in the Java jars.
183+
install(FILES
184+
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../LICENSE"
185+
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../NOTICE"
186+
DESTINATION "${CMAKE_INSTALL_PREFIX}/META-INF"
187+
COMPONENT Runtime
188+
)
189+
181190
if(WIN32 OR LINUX)
182191
install(FILES
183192
"${CMAKE_CURRENT_SOURCE_DIR}/dependencies/nvenc/LICENSE"

0 commit comments

Comments
 (0)