blob: f15e6fb028fd3023cfb9b87349c2498b5a52d338 [file]
<?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>
<artifactId>be-java-extensions</artifactId>
<groupId>org.apache.doris</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>java-writer</artifactId>
<name>Doris BE java-writer Plugin</name>
<description>
Writes blocks to a local delimited file. It carries no third-party dependency of its own,
which makes it the smallest complete example of the plugin shape: a DorisPlugin found
through ServiceLoader, a factory per thing the plugin provides, and an implementation of an
SPI base class.
The packaging is the part worth copying. jni-spi is `provided` because BE already has it on
the system classpath and a plugin that shipped its own copy would be refused at load time -
two copies of the SPI means the class BE hands in is not the class the plugin catches.
Everything else the plugin needs is copied next to it by copy-dependencies and deployed
into the plugin's own directory, where it is visible to this plugin and to nothing else.
</description>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.doris</groupId>
<artifactId>jni-spi</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<!--
The fe parent pom declares slf4j and three log4j artifacts as compile dependencies of
EVERY module, so a plugin that leaves them alone ships log4j-core in its own directory
and logs through a backend the JVM configured for someone else. Narrowed to test here for
the same reason jni-spi narrows them: this plugin logs through java.util.logging, which
is a platform module and therefore already flows into the jni log that JniLogging sets
up. A plugin that genuinely wants slf4j or log4j declares it and ships it, deliberately.
-->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>java-writer</finalName>
<directory>${project.basedir}/target/</directory>
<plugins>
<!--
A plugin is a directory of jars, not one jar with everything shaded into it. Its own
jar is built by the parent's jar plugin; its runtime closure lands beside it here.
`provided` dependencies are excluded by scope, which is what keeps the SPI out.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-plugin-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>