| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- ~ Copyright 2014 The Netty Project
- ~
- ~ The Netty Project 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:
- ~
- ~ https://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 https://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>io.netty</groupId>
- <artifactId>netty-parent</artifactId>
- <version>4.1.86.Final</version>
- </parent>
- <artifactId>netty-transport-native-epoll</artifactId>
- <name>Netty/Transport/Native/Epoll</name>
- <packaging>jar</packaging>
- <properties>
- <javaModuleNameClassifier>${os.detected.name}.${os.detected.arch}</javaModuleNameClassifier>
- <javaModuleName>io.netty.transport.epoll.${javaModuleNameClassifier}</javaModuleName>
- <!-- Needed as we use SelfSignedCertificate in our tests -->
- <argLine.java9.extras>--add-exports java.base/sun.security.x509=ALL-UNNAMED</argLine.java9.extras>
- <unix.common.lib.name>netty-unix-common</unix.common.lib.name>
- <unix.common.lib.dir>${project.build.directory}/unix-common-lib</unix.common.lib.dir>
- <unix.common.lib.unpacked.dir>${unix.common.lib.dir}/META-INF/native/lib</unix.common.lib.unpacked.dir>
- <unix.common.include.unpacked.dir>${unix.common.lib.dir}/META-INF/native/include</unix.common.include.unpacked.dir>
- <jni.compiler.args.cflags>CFLAGS=-O2 -pipe -Werror -fno-omit-frame-pointer -Wunused-variable -fvisibility=hidden -D_FORTIFY_SOURCE=2 -ffunction-sections -fdata-sections -I${unix.common.include.unpacked.dir}</jni.compiler.args.cflags>
- <jni.compiler.args.ldflags>LDFLAGS=-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -Wl,--gc-sections -L${unix.common.lib.unpacked.dir}</jni.compiler.args.ldflags>
- <jni.compiler.args.libs>LIBS=-Wl,--whole-archive -l${unix.common.lib.name} -Wl,--no-whole-archive -ldl</jni.compiler.args.libs>
- <nativeSourceDirectory>${project.basedir}/src/main/c</nativeSourceDirectory>
- <skipTests>true</skipTests>
- <japicmp.skip>true</japicmp.skip>
- </properties>
- <profiles>
- <!--
- Netty must be released from RHEL 6.8 x86_64 or compatible so that:
- 1) we ship x86_64 version of epoll transport officially, and
- 2) we ensure the ABI compatibility with older GLIBC versions.
- The shared library built on a distribution with newer GLIBC
- will not run on older distributions.
- -->
- <profile>
- <id>restricted-release-epoll</id>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>3.0.0</version>
- <dependencies>
- <!-- Provides the 'requireFilesContent' enforcer rule. -->
- <dependency>
- <groupId>com.ceilfors.maven.plugin</groupId>
- <artifactId>enforcer-rules</artifactId>
- <version>1.2.0</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <artifactId>maven-enforcer-plugin</artifactId>
- <executions>
- <execution>
- <id>enforce-release-environment</id>
- <goals>
- <goal>enforce</goal>
- </goals>
- <configuration>
- <rules>
- <requireProperty>
- <regexMessage>
- Release process must be performed on linux-x86_64.
- </regexMessage>
- <property>os.detected.classifier</property>
- <regex>^linux-x86_64$</regex>
- </requireProperty>
- <requireFilesContent>
- <message>
- Release process must be performed on RHEL 6.8 or its derivatives.
- </message>
- <files>
- <file>/etc/redhat-release</file>
- </files>
- <content>release 6.9</content>
- </requireFilesContent>
- </rules>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>linux</id>
- <activation>
- <os>
- <family>linux</family>
- </os>
- </activation>
- <properties>
- <skipTests>false</skipTests>
- </properties>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <!-- unpack the unix-common static library and include files -->
- <execution>
- <id>unpack</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack-dependencies</goal>
- </goals>
- <configuration>
- <includeGroupIds>${project.groupId}</includeGroupIds>
- <includeArtifactIds>netty-transport-native-unix-common</includeArtifactIds>
- <classifier>${jni.classifier}</classifier>
- <outputDirectory>${unix.common.lib.dir}</outputDirectory>
- <includes>META-INF/native/**</includes>
- <overWriteReleases>false</overWriteReleases>
- <overWriteSnapshots>true</overWriteSnapshots>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.fusesource.hawtjni</groupId>
- <artifactId>maven-hawtjni-plugin</artifactId>
- <executions>
- <execution>
- <id>build-native-lib</id>
- <configuration>
- <name>netty_transport_native_epoll_${os.detected.arch}</name>
- <nativeSourceDirectory>${nativeSourceDirectory}</nativeSourceDirectory>
- <libDirectory>${project.build.outputDirectory}</libDirectory>
- <!-- We use Maven's artifact classifier instead.
- This hack will make the hawtjni plugin to put the native library
- under 'META-INF/native' rather than 'META-INF/native/${platform}'. -->
- <platform>.</platform>
- <configureArgs>
- <arg>${jni.compiler.args.ldflags}</arg>
- <arg>${jni.compiler.args.libs}</arg>
- <arg>${jni.compiler.args.cflags}</arg>
- <configureArg>--libdir=${project.build.directory}/native-build/target/lib</configureArg>
- </configureArgs>
- </configuration>
- <goals>
- <goal>generate</goal>
- <goal>build</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <!-- Generate the JAR that contains the native library in it. -->
- <execution>
- <id>native-jar</id>
- <goals>
- <goal>jar</goal>
- </goals>
- <configuration>
- <archive>
- <manifest>
- <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
- </manifest>
- <manifestEntries>
- <Bundle-NativeCode>META-INF/native/libnetty_transport_native_epoll_${os.detected.arch}.so; osname=Linux; processor=${os.detected.arch},*</Bundle-NativeCode>
- <Fragment-Host>io.netty.transport-classes-epoll</Fragment-Host>
- <Automatic-Module-Name>${javaModuleName}</Automatic-Module-Name>
- </manifestEntries>
- <index>true</index>
- <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
- </archive>
- <classifier>${jni.classifier}</classifier>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-transport-native-unix-common</artifactId>
- <version>${project.version}</version>
- <classifier>${jni.classifier}</classifier>
- <!--
- The unix-common with classifier dependency is optional because it is not a runtime dependency, but a build time
- dependency to get the static library which is built directly into the shared library generated by this project.
- -->
- <optional>true</optional>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>linux-aarch64</id>
- <properties>
- <!-- use aarch_64 as this is also what os.detected.arch will use on an aarch64 system -->
- <jni.classifier>${os.detected.name}-aarch_64</jni.classifier>
- <javaModuleNameClassifier>${os.detected.name}.aarch_64</javaModuleNameClassifier>
- </properties>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>3.0.0</version>
- <dependencies>
- <!-- Provides the 'requireFilesContent' enforcer rule. -->
- <dependency>
- <groupId>com.ceilfors.maven.plugin</groupId>
- <artifactId>enforcer-rules</artifactId>
- <version>1.2.0</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <artifactId>maven-enforcer-plugin</artifactId>
- <executions>
- <execution>
- <id>enforce-release-environment</id>
- <goals>
- <goal>enforce</goal>
- </goals>
- <configuration>
- <rules>
- <requireProperty>
- <regexMessage>
- Cross compile and Release process must be performed on linux-x86_64.
- </regexMessage>
- <property>os.detected.classifier</property>
- <regex>^linux-x86_64.*</regex>
- </requireProperty>
- <requireFilesContent>
- <message>
- Cross compile and Release process must be performed on RHEL 7.6 or its derivatives.
- </message>
- <files>
- <file>/etc/redhat-release</file>
- </files>
- <content>release 7.6</content>
- </requireFilesContent>
- </rules>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <!-- unpack the unix-common static library and include files -->
- <execution>
- <id>unpack</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack-dependencies</goal>
- </goals>
- <configuration>
- <includeGroupIds>${project.groupId}</includeGroupIds>
- <includeArtifactIds>netty-transport-native-unix-common</includeArtifactIds>
- <classifier>${jni.classifier}</classifier>
- <outputDirectory>${unix.common.lib.dir}</outputDirectory>
- <includes>META-INF/native/**</includes>
- <overWriteReleases>false</overWriteReleases>
- <overWriteSnapshots>true</overWriteSnapshots>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.fusesource.hawtjni</groupId>
- <artifactId>maven-hawtjni-plugin</artifactId>
- <executions>
- <execution>
- <id>build-native-lib</id>
- <configuration>
- <name>netty_transport_native_epoll_aarch_64</name>
- <nativeSourceDirectory>${nativeSourceDirectory}</nativeSourceDirectory>
- <libDirectory>${project.build.outputDirectory}</libDirectory>
- <!-- We use Maven's artifact classifier instead.
- This hack will make the hawtjni plugin to put the native library
- under 'META-INF/native' rather than 'META-INF/native/${platform}'. -->
- <platform>.</platform>
- <configureArgs>
- <arg>${jni.compiler.args.ldflags}</arg>
- <arg>${jni.compiler.args.libs}</arg>
- <arg>${jni.compiler.args.cflags}</arg>
- <configureArg>--libdir=${project.build.directory}/native-build/target/lib</configureArg>
- <configureArg>--host=aarch64-linux-gnu</configureArg>
- <configureArg>CC=aarch64-none-linux-gnu-gcc</configureArg>
- </configureArgs>
- </configuration>
- <goals>
- <goal>generate</goal>
- <goal>build</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <!-- Generate the JAR that contains the native library in it. -->
- <execution>
- <id>native-jar</id>
- <goals>
- <goal>jar</goal>
- </goals>
- <configuration>
- <archive>
- <manifest>
- <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
- </manifest>
- <manifestEntries>
- <Bundle-NativeCode>META-INF/native/libnetty_transport_native_epoll_aarch_64.so; osname=Linux; processor=aarch64,*</Bundle-NativeCode>
- <Fragment-Host>io.netty.transport-classes-epoll</Fragment-Host>
- <Automatic-Module-Name>${javaModuleName}</Automatic-Module-Name>
- </manifestEntries>
- <index>true</index>
- <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
- </archive>
- <classifier>${jni.classifier}</classifier>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-transport-native-unix-common</artifactId>
- <version>${project.version}</version>
- <classifier>${jni.classifier}</classifier>
- <!--
- The unix-common with classifier dependency is optional because it is not a runtime dependency, but a build time
- dependency to get the static library which is built directly into the shared library generated by this project.
- -->
- <optional>true</optional>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
- <dependencies>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-common</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-buffer</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-transport</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-transport-native-unix-common</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-transport-classes-epoll</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-testsuite</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-transport-native-unix-common-tests</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>${tcnative.artifactId}</artifactId>
- <classifier>${tcnative.classifier}</classifier>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>io.github.artsok</groupId>
- <artifactId>rerunner-jupiter</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <!-- Also include c files in source jar -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>${nativeSourceDirectory}</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <!-- Generate the fallback JAR that does not contain the native library. -->
- <execution>
- <id>default-jar</id>
- <configuration>
- <excludes>
- <exclude>META-INF/native/**</exclude>
- </excludes>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </project>
|