Skip to content

Commit

Permalink
OAK-9989: introduce shaded Guava subproject (#878)
Browse files Browse the repository at this point in the history
* OAK-9989: introduce shaded Guava subproject

* OAK-9989: fix package name for package info

* OAK-9989: removue unused package-info
  • Loading branch information
reschke committed Mar 28, 2023
1 parent 2527702 commit 16dbd62
Show file tree
Hide file tree
Showing 3 changed files with 149 additions and 0 deletions.
28 changes: 28 additions & 0 deletions oak-shaded-guava/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Oak Shaded Guava
================

WARNING: for Oak-internal use only!

This component contains a shaded copy of the Google Guava library.

License
-------

(see the top-level [LICENSE.txt](../LICENSE.txt) for full license details)

Collective work: Copyright 2012 The Apache Software Foundation.

Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
120 changes: 120 additions & 0 deletions oak-shaded-guava/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-parent</artifactId>
<version>1.51-SNAPSHOT</version>
<relativePath>../oak-parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>oak-shaded-guava</artifactId>
<packaging>bundle</packaging>

<properties>
<shaded.guava.version>20.0</shaded.guava.version>
<exported.guava.version>20.0</exported.guava.version>
<pref>org.apache.jackrabbit.guava</pref>
</properties>

<name>Jackrabbit Guava Wrapper</name>

<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>com.google.guava:guava</include>
<include>com.google.guava:failureaccess</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.google</pattern>
<shadedPattern>${pref}</shadedPattern>
</relocation>
</relocations>
<createDependencyReducedPom>false</createDependencyReducedPom>
<createSourcesJar>true</createSourcesJar>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>org.apache.jackrabbit.guava</Bundle-SymbolicName>
<!-- Export-Package and Import-Package must be declared explicitly since the maven-bundle-plugin executes before maven-shade-plugin, so the guava classes aren't present at this time.
Note that these should match the specifications from the MANIFEST.mf file of the guava jar this jar will be based on. -->
<Export-Package>
${pref}.common.annotations;version="${exported.guava.version}",
${pref}.common.base;version="${exported.guava.version}",
${pref}.common.cache;version="${exported.guava.version}";uses:="${pref}.common.base,${pref}.common.collect,${pref}.common.util.concurrent",
${pref}.common.collect;version="${exported.guava.version}";uses:="${pref}.common.base",
${pref}.common.escape;version="${exported.guava.version}";uses:="${pref}.common.base",
${pref}.common.eventbus;version="${exported.guava.version}",
${pref}.common.graph;version="${exported.guava.version}";uses:="${pref}.common.collect",
${pref}.common.hash;version="${exported.guava.version}";uses:="${pref}.common.base",
${pref}.common.html;version="${exported.guava.version}";uses:="${pref}.common.escape",
${pref}.common.io;version="${exported.guava.version}";uses:="${pref}.common.base,${pref}.common.collect,${pref}.common.graph,${pref}.common.hash",
${pref}.common.math;version="${exported.guava.version}",${pref}.common.net;version="${exported.guava.version}";uses:="${pref}.common.base,${pref}.common.collect,${pref}.common.escape",
${pref}.common.primitives;version="${exported.guava.version}";uses:="${pref}.common.base",
${pref}.common.reflect;version="${exported.guava.version}";uses:="${pref}.common.collect,${pref}.common.io",
${pref}.common.util.concurrent;version="${exported.guava.version}";uses:="${pref}.common.base,${pref}.common.collect,${pref}.common.util.concurrent.internal",
${pref}.common.xml;version="${exported.guava.version}";uses:="${pref}.common.escape"
</Export-Package>
<Import-Package>
javax.annotation;resolution:=optional;version="[3.0,4)",
javax.crypto;resolution:=optional,
javax.crypto.spec;resolution:=optional,
sun.misc;resolution:=optional
</Import-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${shaded.guava.version}</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.annotation</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
</dependency>
</dependencies>
</project>
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<modules>
<module>oak-parent</module>
<module>oak-jackrabbit-api</module>
<module>oak-shaded-guava</module>
<module>oak-commons</module>
<module>oak-api</module>
<module>oak-core-spi</module>
Expand Down

0 comments on commit 16dbd62

Please sign in to comment.