| <?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.fory</groupId> |
| <artifactId>fory-parent</artifactId> |
| <version>1.5.0-SNAPSHOT</version> |
| </parent> |
| <modelVersion>4.0.0</modelVersion> |
| |
| <artifactId>fory-format</artifactId> |
| |
| <description> |
| Apache Fory™ is a blazingly fast multi-language serialization framework powered by jit and zero-copy. |
| </description> |
| |
| <properties> |
| <maven.compiler.source>11</maven.compiler.source> |
| <maven.compiler.target>11</maven.compiler.target> |
| <arrow.version>18.3.0</arrow.version> |
| <jackson-bom.version>2.18.8</jackson-bom.version> |
| <fory.java.rootdir>${basedir}/..</fory.java.rootdir> |
| </properties> |
| |
| <dependencyManagement> |
| <dependencies> |
| <dependency> |
| <groupId>com.fasterxml.jackson</groupId> |
| <artifactId>jackson-bom</artifactId> |
| <version>${jackson-bom.version}</version> |
| <type>pom</type> |
| <scope>import</scope> |
| </dependency> |
| </dependencies> |
| </dependencyManagement> |
| |
| <dependencies> |
| <dependency> |
| <groupId>org.apache.fory</groupId> |
| <artifactId>fory-core</artifactId> |
| <version>${project.version}</version> |
| </dependency> |
| <!-- If netty has conflict, users need to exclude packages in their pom --> |
| <dependency> |
| <groupId>org.apache.arrow</groupId> |
| <artifactId>arrow-vector</artifactId> |
| <version>${arrow.version}</version> |
| <!-- <classifier>shade-format-flatbuffer</classifier> --> |
| </dependency> |
| <dependency> |
| <groupId>com.fasterxml.jackson.core</groupId> |
| <artifactId>jackson-databind</artifactId> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.arrow</groupId> |
| <artifactId>arrow-memory-core</artifactId> |
| <version>${arrow.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.arrow</groupId> |
| <artifactId>arrow-memory-unsafe</artifactId> |
| <version>${arrow.version}</version> |
| <scope>runtime</scope> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.apache.fory</groupId> |
| <artifactId>fory-test-core</artifactId> |
| <version>${project.version}</version> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>com.google.guava</groupId> |
| <artifactId>guava</artifactId> |
| <scope>test</scope> |
| </dependency> |
| </dependencies> |
| |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-jar-plugin</artifactId> |
| <configuration> |
| <archive> |
| <manifestEntries> |
| <Automatic-Module-Name>org.apache.fory.format</Automatic-Module-Name> |
| <Multi-Release>true</Multi-Release> |
| </manifestEntries> |
| </archive> |
| </configuration> |
| </plugin> |
| </plugins> |
| </build> |
| |
| <profiles> |
| <profile> |
| <id>jpms-java11</id> |
| <activation> |
| <jdk>[11,)</jdk> |
| </activation> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-antrun-plugin</artifactId> |
| <version>3.1.0</version> |
| <executions> |
| <execution> |
| <id>compile-java11-module-info</id> |
| <phase>process-classes</phase> |
| <goals> |
| <goal>run</goal> |
| </goals> |
| <configuration> |
| <target> |
| <mkdir dir="${project.build.directory}/jpms-classes/java11"/> |
| <condition |
| property="fory.core.module.jar" |
| value="${project.basedir}/../fory-core/target/fory-core-${project.version}.jar" |
| else="${settings.localRepository}/org/apache/fory/fory-core/${project.version}/fory-core-${project.version}.jar"> |
| <available |
| file="${project.basedir}/../fory-core/target/fory-core-${project.version}.jar"/> |
| </condition> |
| <path id="fory.core.compile.path"> |
| <pathelement location="${project.basedir}/../fory-core/target/classes"/> |
| <pathelement |
| location="${settings.localRepository}/org/apache/fory/fory-core/${project.version}/fory-core-${project.version}.jar"/> |
| </path> |
| <path id="compile.module.path.elements"> |
| <pathelement location="${fory.core.module.jar}"/> |
| <difference> |
| <path refid="maven.compile.classpath"/> |
| <path refid="fory.core.compile.path"/> |
| </difference> |
| </path> |
| <pathconvert property="compile.module.path" refid="compile.module.path.elements" |
| pathsep="${path.separator}"/> |
| <javac srcdir="${project.basedir}/src/main/java11" |
| destdir="${project.build.directory}/jpms-classes/java11" |
| includeantruntime="false" |
| fork="true" |
| executable="${java.home}/bin/javac" |
| debug="true"> |
| <include name="module-info.java"/> |
| <compilerarg value="--release"/> |
| <compilerarg value="11"/> |
| <compilerarg value="--module-path"/> |
| <compilerarg path="${compile.module.path}"/> |
| <compilerarg value="--patch-module"/> |
| <compilerarg value="org.apache.fory.format=${project.build.outputDirectory}"/> |
| </javac> |
| </target> |
| </configuration> |
| </execution> |
| <execution> |
| <id>inject-java11-module-info</id> |
| <phase>package</phase> |
| <goals> |
| <goal>run</goal> |
| </goals> |
| <configuration> |
| <target> |
| <jar destfile="${project.build.directory}/${project.build.finalName}.jar" update="true"> |
| <zipfileset dir="${project.build.directory}/jpms-classes/java11" |
| prefix="META-INF/versions/11" |
| includes="module-info.class"/> |
| </jar> |
| </target> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| <profile> |
| <id>releaseShade</id> |
| <activation> |
| <property> |
| <name>releaseShade</name> |
| <value>true</value> |
| </property> |
| </activation> |
| <properties> |
| <output.directory>${basedir}</output.directory> |
| </properties> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-shade-plugin</artifactId> |
| <executions> |
| <execution> |
| <phase>package</phase> |
| <goals> |
| <goal>shade</goal> |
| </goals> |
| <configuration> |
| <minimizeJar>false</minimizeJar> |
| <artifactSet> |
| <includes> |
| <include>org.codehaus.janino</include> |
| <include>org.apache.arrow</include> |
| <include>io.netty</include> |
| </includes> |
| </artifactSet> |
| <relocations> |
| <relocation> |
| <pattern>org.codehaus</pattern> |
| <shadedPattern>org.apache.fory.shaded.org.codehaus</shadedPattern> |
| </relocation> |
| <relocation> |
| <pattern>org.apache.arrow</pattern> |
| <shadedPattern>org.apache.fory.shaded.org.apache.arrow</shadedPattern> |
| </relocation> |
| <relocation> |
| <pattern>io.netty</pattern> |
| <shadedPattern>org.apache.fory.shaded.io.netty</shadedPattern> |
| </relocation> |
| </relocations> |
| <filters> |
| <filter> |
| <artifact>*:*</artifact> |
| <excludes> |
| <exclude>module-info.class</exclude> |
| <exclude>META-INF/versions/**/module-info.class</exclude> |
| <exclude>META-INF/*.SF</exclude> |
| <exclude>META-INF/*.DSA</exclude> |
| <exclude>META-INF/*.RSA</exclude> |
| <exclude>META-INF/**/janino/*</exclude> |
| </excludes> |
| </filter> |
| </filters> |
| <transformers> |
| <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> |
| <manifestEntries> |
| <Multi-Release>true</Multi-Release> |
| <Automatic-Module-Name>org.apache.fory.format</Automatic-Module-Name> |
| </manifestEntries> |
| </transformer> |
| <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> |
| </transformers> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| </profiles> |
| </project> |