netty-tcnative-openssl-static
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency> <groupId>com.luhuiguo.netty</groupId> <artifactId>netty-tcnative-openssl-static</artifactId> <version>2.0.47.GM</version> </dependency>
<?xml version="1.0" encoding="UTF-8"?> <!-- ~ Copyright 2016 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: ~ ~ 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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>io.netty</groupId> <artifactId>netty-tcnative-parent</artifactId> <version>2.0.47.Final</version> </parent> <groupId>com.luhuiguo.netty</groupId> <artifactId>netty-tcnative-openssl-static</artifactId> <version>2.0.47.GM</version> <packaging>jar</packaging> <name>Netty/TomcatNative [OpenSSL - Static]</name> <description> A Mavenized fork of Tomcat Native which incorporates various patches. This artifact is statically linked to OpenSSL and Apache APR. </description> <properties> <opensslMinorVersion>1.1.1</opensslMinorVersion> <opensslPatchVersion>b</opensslPatchVersion> <!-- <opensslSourceDir>${project.build.directory}/openssl-source</opensslSourceDir> --> <opensslSourceDir>${project.basedir}/../../openssl-source</opensslSourceDir> <opensslHome>${project.build.directory}/openssl</opensslHome> <linkStatic>true</linkStatic> <compileLibrary>true</compileLibrary> <!-- Don't deploy this artifact to Maven Central --> <maven.deploy.skip>true</maven.deploy.skip> <skipJapicmp>true</skipJapicmp> </properties> <build> <pluginManagement> <plugins> <plugin> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifestEntries> <Automatic-Module-Name>io.netty.tcnative.openssl</Automatic-Module-Name> </manifestEntries> </archive> </configuration> </plugin> </plugins> </pluginManagement> <plugins> <!-- Add the OpenSSL version to the manifest. --> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <configuration> <instructions> <Apr-Version>${aprVersion}</Apr-Version> <OpenSSL-Version>${opensslVersion}</OpenSSL-Version> </instructions> </configuration> </plugin> <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>${generatedSourcesDir}/java</source> </sources> </configuration> </execution> </executions> </plugin> <!-- Set the classifier property based on the settings of the os-detector-plugin. Fedora-based systems use a different soname for OpenSSL than other linux distributions. Use a custom classifier ending in "-fedora" when building on fedora-based systems. Systems based on SUSE or Arch Linux build their OpenSSL library a bit differently and also require a custom classifier: "-suse" and "-arch". --> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <!-- Build the additional JAR that contains the native library. --> <execution> <id>native-jar</id> <phase>package</phase> <goals> <goal>run</goal> </goals> <configuration> <target> <copy todir="${nativeJarWorkdir}"> <zipfileset src="${defaultJarFile}" /> </copy> <copy todir="${nativeJarWorkdir}" includeEmptyDirs="false"> <zipfileset dir="${nativeLibOnlyDir}/META-INF/native" /> <regexpmapper handledirsep="yes" from="^(?:[^/]+/)*([^/]+)$" to="META-INF/native/\1" /> </copy> <!-- linux / osx --> <move todir="${nativeJarWorkdir}/META-INF/native/" flatten="true"> <fileset dir="${nativeJarWorkdir}/META-INF/native/" /> <globmapper from="libnetty_tcnative.*" to="libnetty_tcnative_${os.detected.name}_${jniArch}.*" /> </move> <!-- windows--> <move todir="${nativeJarWorkdir}/META-INF/native/" flatten="true"> <fileset dir="${nativeJarWorkdir}/META-INF/native/" /> <globmapper from="netty_tcnative.*" to="netty_tcnative_${os.detected.name}_${jniArch}.*" /> </move> <!-- Append the Bundle-NativeCode section --> <manifest file="${nativeJarWorkdir}/META-INF/MANIFEST.MF" mode="update"> <attribute name="Bundle-NativeCode" value="${tcnativeManifest}" /> </manifest> <jar destfile="${nativeJarFile}" manifest="${nativeJarWorkdir}/META-INF/MANIFEST.MF" basedir="${nativeJarWorkdir}" index="true" excludes="META-INF/MANIFEST.MF,META-INF/INDEX.LIST" /> <!-- Adjust the classifier used for different OS distributions which provide differently-built openSSL libraries --> <condition property="classifier" value="${jniClassifier}-fedora"> <isset property="os.detected.release.like.fedora" /> </condition> <condition property="classifier" value="${jniClassifier}-suse"> <isset property="os.detected.release.like.suse" /> </condition> <condition property="classifier" value="${jniClassifier}-arch"> <isset property="os.detected.release.like.arch" /> </condition> <condition property="classifier" value="${jniClassifier}"> <not> <or> <isset property="os.detected.release.like.fedora" /> <isset property="os.detected.release.like.suse" /> <isset property="os.detected.release.like.arch" /> </or> </not> </condition> <attachartifact file="${nativeJarFile}" classifier="${classifier}" type="jar" /> </target> </configuration> </execution> </executions> </plugin> <!-- Configure the distribution statically linked against OpenSSL and APR --> <plugin> <groupId>org.fusesource.hawtjni</groupId> <artifactId>maven-hawtjni-plugin</artifactId> <executions> <execution> <id>build-native-lib</id> <goals> <goal>generate</goal> <goal>build</goal> </goals> <phase>compile</phase> <configuration> <name>netty_tcnative</name> <nativeSourceDirectory>${generatedSourcesDir}/c</nativeSourceDirectory> <customPackageDirectory>${generatedSourcesDir}/native-package</customPackageDirectory> <libDirectory>${nativeLibOnlyDir}</libDirectory> <forceAutogen>${forceAutogen}</forceAutogen> <forceConfigure>${forceConfigure}</forceConfigure> <windowsBuildTool>msbuild</windowsBuildTool> <configureArgs> <configureArg>${macOsxDeploymentTarget}</configureArg> <configureArg>--with-ssl=${opensslHome}</configureArg> <configureArg>--with-apr=${aprHome}</configureArg> <configureArg>--with-static-libs</configureArg> <configureArg>--libdir=${project.build.directory}/native-build/target/lib</configureArg> </configureArgs> </configuration> </execution> </executions> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>${project.parent.groupId}</groupId> <artifactId>netty-tcnative-classes</artifactId> <version>${project.parent.version}</version> </dependency> </dependencies> <profiles> <profile> <id>build-openssl-windows</id> <activation> <os> <family>windows</family> </os> </activation> <build> <plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>source-openssl</id> <phase>generate-sources</phase> <goals> <goal>run</goal> </goals> <configuration> <target> <!-- Add the ant tasks from ant-contrib --> <taskdef resource="net/sf/antcontrib/antcontrib.properties" /> <if> <available file="${opensslSourceDir}" /> <then> <echo message="OpenSSL was already downloaded, skipping the build step." /> </then> <else> <echo message="Downloading OpenSSL" /> <condition property="opensslFound"> <http url="https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz" /> </condition> <if> <equals arg1="${opensslFound}" arg2="true" /> <then> <!-- Download the openssl source. --> <get src="https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz" dest="${project.build.directory}/openssl-${opensslVersion}.tar.gz" verbose="on" /> </then> <else> <!-- Download the openssl source from the old directory --> <get src="https://www.openssl.org/source/old/${opensslMinorVersion}/openssl-${opensslVersion}.tar.gz" dest="${project.build.directory}/openssl-${opensslVersion}.tar.gz" verbose="on" /> </else> </if> <checksum file="${project.build.directory}/openssl-${opensslVersion}.tar.gz" algorithm="SHA-256" property="${opensslSha256}" verifyProperty="isEqual" /> <gunzip src="${project.build.directory}/openssl-${opensslVersion}.tar.gz" dest="${project.build.directory}/" /> <untar src="${project.build.directory}/openssl-${opensslVersion}.tar" dest="${project.build.directory}/" /> <move file="${project.build.directory}/openssl-${opensslVersion}" tofile="${opensslSourceDir}" /> </else> </if> </target> </configuration> </execution> <execution> <id>build-openssl</id> <phase>compile</phase> <goals> <goal>run</goal> </goals> <configuration> <target> <!-- Add the ant tasks from ant-contrib --> <taskdef resource="net/sf/antcontrib/antcontrib.properties" /> <if> <available file="${opensslHome}" /> <then> <echo message="OpenSSL was already build, skipping the build step." /> </then> <else> <echo message="Building OpenSSL" /> <!-- Build for the correct platform --> <pathconvert property="sslHomePath" targetos="windows"> <path location="${opensslHome}" /> </pathconvert> <if> <equals arg1="${archBits}" arg2="32" /> <then> <echo message="Building OpenSSL for Win32" /> <exec executable="perl" failonerror="true" dir="${opensslSourceDir}" resolveexecutable="true"> <arg line="Configure VC-WIN32 --prefix=${sslHomePath}" /> </exec> <exec executable="nmake" failonerror="true" dir="${opensslSourceDir}" resolveexecutable="true"> <arg line="install" /> </exec> </then> <else> <echo message="Building OpenSSL for Win64" /> <exec executable="perl" failonerror="true" dir="${opensslSourceDir}" resolveexecutable="true"> <arg line="Configure VC-WIN64A --prefix=${sslHome}" /> </exec> <exec executable="nmake" failonerror="true" dir="${opensslSourceDir}" resolveexecutable="true"> <arg line="install" /> </exec> </else> </if> </else> </if> </target> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> <profile> <id>build-openssl-linux</id> <activation> <os> <family>linux</family> </os> </activation> <build> <plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>source-openssl</id> <phase>generate-sources</phase> <goals> <goal>run</goal> </goals> <configuration> <target> <!-- Add the ant tasks from ant-contrib --> <taskdef resource="net/sf/antcontrib/antcontrib.properties" /> <if> <available file="${opensslSourceDir}" /> <then> <echo message="OpenSSL was already downloaded, skipping the build step." /> </then> <else> <echo message="Downloading OpenSSL" /> <condition property="opensslFound"> <http url="https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz" /> </condition> <if> <equals arg1="${opensslFound}" arg2="true" /> <then> <!-- Download the openssl source. --> <get src="https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz" dest="${project.build.directory}/openssl-${opensslVersion}.tar.gz" verbose="on" /> </then> <else> <!-- Download the openssl source from the old directory --> <get src="https://www.openssl.org/source/old/${opensslMinorVersion}/openssl-${opensslVersion}.tar.gz" dest="${project.build.directory}/openssl-${opensslVersion}.tar.gz" verbose="on" /> </else> </if> <checksum file="${project.build.directory}/openssl-${opensslVersion}.tar.gz" algorithm="SHA-256" property="${opensslSha256}" verifyProperty="isEqual" /> <!-- Use the tar command (rather than the untar ant task) in order to preserve file permissions. --> <exec executable="tar" failonerror="true" dir="${project.build.directory}/" resolveexecutable="true"> <arg line="xfvz openssl-${opensslVersion}.tar.gz" /> </exec> <move file="${project.build.directory}/openssl-${opensslVersion}" tofile="${opensslSourceDir}" /> </else> </if> </target> </configuration> </execution> <execution> <id>build-openssl</id> <phase>compile</phase> <goals> <goal>run</goal> </goals> <configuration> <target> <!-- Add the ant tasks from ant-contrib --> <taskdef resource="net/sf/antcontrib/antcontrib.properties" /> <if> <available file="${opensslHome}" /> <then> <echo message="OpenSSL was already build, skipping the build step." /> </then> <else> <echo message="Building OpenSSL" /> <mkdir dir="${opensslHome}" /> <exec executable="config" failonerror="true" dir="${opensslSourceDir}" resolveexecutable="true"> <arg line="-O3 -fno-omit-frame-pointer -fPIC no-ssl2 no-ssl3 no-shared no-comp -DOPENSSL_NO_HEARTBEATS --prefix=${opensslHome} --openssldir=${opensslHome}" /> </exec> <exec executable="make" failonerror="true" dir="${opensslSourceDir}" resolveexecutable="true"> <arg value="depend" /> </exec> <exec executable="make" failonerror="true" dir="${opensslSourceDir}" resolveexecutable="true" /> <exec executable="make" failonerror="true" dir="${opensslSourceDir}" resolveexecutable="true"> <!-- Don't install manpages to make things as fast a possible --> <arg value="install_sw" /> </exec> </else> </if> </target> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> <profile> <id>build-openssl-mac</id> <activation> <os> <family>mac</family> </os> </activation> <build> <plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>source-openssl</id> <phase>generate-sources</phase> <goals> <goal>run</goal> </goals> <configuration> <target> <!-- Add the ant tasks from ant-contrib --> <taskdef resource="net/sf/antcontrib/antcontrib.properties" /> <if> <available file="${opensslSourceDir}" /> <then> <echo message="OpenSSL was already downloaded, skipping the build step." /> </then> <else> <echo message="Downloading OpenSSL" /> <condition property="opensslFound"> <http url="https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz" /> </condition> <if> <equals arg1="${opensslFound}" arg2="true" /> <then> <!-- Download the openssl source. --> <get src="https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz" dest="${project.build.directory}/openssl-${opensslVersion}.tar.gz" verbose="on" /> </then> <else> <!-- Download the openssl source from the old directory --> <get src="https://www.openssl.org/source/old/${opensslMinorVersion}/openssl-${opensslVersion}.tar.gz" dest="${project.build.directory}/openssl-${opensslVersion}.tar.gz" verbose="on" /> </else> </if> <checksum file="${project.build.directory}/openssl-${opensslVersion}.tar.gz" algorithm="SHA-256" property="${opensslSha256}" verifyProperty="isEqual" /> <!-- Use the tar command (rather than the untar ant task) in order to preserve file permissions. --> <exec executable="tar" failonerror="true" dir="${project.build.directory}/" resolveexecutable="true"> <arg line="xfvz openssl-${opensslVersion}.tar.gz" /> </exec> <move file="${project.build.directory}/openssl-${opensslVersion}" tofile="${opensslSourceDir}" /> </else> </if> </target> </configuration> </execution> <execution> <id>build-openssl</id> <phase>compile</phase> <goals> <goal>run</goal> </goals> <configuration> <target> <!-- Add the ant tasks from ant-contrib --> <taskdef resource="net/sf/antcontrib/antcontrib.properties" /> <if> <available file="${opensslHome}" /> <then> <echo message="OpenSSL was already build, skipping the build step." /> </then> <else> <echo message="Building OpenSSL" /> <mkdir dir="${opensslHome}" /> <exec executable="Configure" failonerror="true" dir="${opensslSourceDir}" resolveexecutable="true"> <arg line="darwin64-x86_64-cc -O3 -fno-omit-frame-pointer -fPIC no-ssl2 no-ssl3 no-shared no-comp -DOPENSSL_NO_HEARTBEATS --prefix=${opensslHome} --openssldir=${opensslHome} ${macOsxDeploymentTarget}" /> </exec> <exec executable="make" failonerror="true" dir="${opensslSourceDir}" resolveexecutable="true"> <arg value="depend" /> </exec> <exec executable="make" failonerror="true" dir="${opensslSourceDir}" resolveexecutable="true" /> <exec executable="make" failonerror="true" dir="${opensslSourceDir}" resolveexecutable="true"> <!-- Don't install manpages to make things as fast a possible --> <arg value="install_sw" /> </exec> </else> </if> </target> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles> </project>