blob: 218f3d429f44cd3f11ce84cd80673e797b95adcb [file] [log] [blame]
<?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:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>statefun-parent</artifactId>
<groupId>org.apache.flink</groupId>
<version>3.0.0</version>
</parent>
<artifactId>statefun-shaded</artifactId>
<name>statefun-shaded</name>
<packaging>pom</packaging>
<properties>
<protobuf.package>com.google.protobuf</protobuf.package>
<shaded.prefix>org.apache.flink.statefun.sdk.shaded</shaded.prefix>
<generated-sources.basedir>${basedir}/target/generated-sources/</generated-sources.basedir>
</properties>
<modules>
<module>statefun-protobuf-shaded</module>
<module>statefun-protocol-shaded</module>
</modules>
<build>
<pluginManagement>
<plugins>
<!--
Plugin used for relocating Protobuf dependency in child projects.
This defines the renaming pattern for the relocation.
Child projects should place sources to relocate under ${generated-sources.basedir} and
simply apply this plugin in their builds.
This plugin is executed during the process-sources phase, so that the final produced
source codes are already relocated. In contrast to the usual shading (via the
maven-shade-plugin, with which the relocation happens at package / JAR creation time, i.e.
_after_ the sources are generated) this allows IDEs to index and reference the already
relocated code directly across modules in a multi-module project.
-->
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<basedir>${generated-sources.basedir}</basedir>
<includes>
<include>**/*.java</include>
</includes>
<replacements>
<replacement>
<token>([^\.])${protobuf.package}</token>
<value>$1${shaded.prefix}.${protobuf.package}</value>
</replacement>
<replacement>
<token>(public)(\W+static)?(\W+final)?(\W+class)</token>
<value>@javax.annotation.Generated("proto") $1$2$3$4</value>
</replacement>
<!-- replacer doesn't support anchoring or negative lookbehind -->
<replacement>
<token>(@javax.annotation.Generated\("proto"\) ){2}</token>
<value>$1</value>
</replacement>
</replacements>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>