netty-tcnative-openssl-static-2.0.27.Final.pom

Checksums

MD5 61775b0a22ef648379ffae420aaf25d2
SHA1 8375a19869df4767b3ba56c0989a4401039080fa
SHA256 335e63e8f738138628f280df4c57afa3ae5e9d73069b03552adad312afd6c11c
SHA512 ce43f080370eac0ff5c6b0f6f074feb530b7e767fc05cafabf2bed83cea47126d3efbf27b368f89048a661e74ab92ea7e72caf4c6a9cc03c2b8cf648c24984fe

POM

<?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.27.Final</version>
  </parent>
  <artifactId>netty-tcnative-openssl-static</artifactId>
  <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>
    <opensslBuildDir>${project.build.directory}/openssl-${opensslVersion}</opensslBuildDir>
    <linkStatic>true</linkStatic>
    <!-- Don't deploy this artifact to Maven Central -->
    <maven.deploy.skip>true</maven.deploy.skip>
  </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>

      <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>
                <jar destfile="${nativeJarFile}" manifest="${nativeJarWorkdir}/META-INF/MANIFEST.MF" basedir="${nativeJarWorkdir}" index="true" excludes="META-INF/MANIFEST.MF,META-INF/INDEX.LIST" />
                <attachartifact file="${nativeJarFile}" classifier="${os.detected.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>--with-ssl=${sslHome}</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>

  <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="${opensslBuildDir}" />
                      <then>
                        <echo message="OpenSSL was already downloaded, skipping the build step." />
                      </then>
                      <else>
                        <echo message="Downloading OpenSSL" />

                        <get src="https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz" dest="${project.build.directory}/openssl-${opensslVersion}.tar.gz" verbose="on" />
                        <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}/" />
                      </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="${sslHome}" />
                      <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="${sslHome}" />
                        </pathconvert>
                        <if>
                          <equals arg1="${archBits}" arg2="32" />
                          <then>
                            <echo message="Building OpenSSL for Win32" />
                            <exec executable="perl" failonerror="true" dir="${opensslBuildDir}" resolveexecutable="true">
                              <arg line="Configure VC-WIN32 --prefix=${sslHomePath}" />
                            </exec>
                            <exec executable="nmake" failonerror="true" dir="${opensslBuildDir}" resolveexecutable="true">
                              <arg line="install" />
                            </exec>
                          </then>
                          <else>
                            <echo message="Building OpenSSL for Win64" />
                            <exec executable="perl" failonerror="true" dir="${opensslBuildDir}" resolveexecutable="true">
                              <arg line="Configure VC-WIN64A --prefix=${sslHome}" />
                            </exec>
                            <exec executable="nmake" failonerror="true" dir="${opensslBuildDir}" 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="${opensslBuildDir}" />
                      <then>
                        <echo message="OpenSSL was already downloaded, skipping the build step." />
                      </then>
                      <else>
                        <echo message="Downloading OpenSSL" />

                        <get src="https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz" dest="${project.build.directory}/openssl-${opensslVersion}.tar.gz" verbose="on" />
                        <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>
                      </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="${sslHome}" />
                      <then>
                        <echo message="OpenSSL was already build, skipping the build step." />
                      </then>
                      <else>
                        <echo message="Building OpenSSL" />
                        <mkdir dir="${sslHome}" />
                        <exec executable="config" failonerror="true" dir="${opensslBuildDir}" resolveexecutable="true">
                          <arg line="-O3 -fno-omit-frame-pointer -fPIC no-ssl2 no-ssl3 no-shared no-comp -DOPENSSL_NO_HEARTBEATS --prefix=${sslHome} --openssldir=${sslHome}" />
                        </exec>
                        <exec executable="make" failonerror="true" dir="${opensslBuildDir}" resolveexecutable="true">
                          <arg value="depend" />
                        </exec>
                        <exec executable="make" failonerror="true" dir="${opensslBuildDir}" resolveexecutable="true" />
                        <exec executable="make" failonerror="true" dir="${opensslBuildDir}" 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="${opensslBuildDir}" />
                      <then>
                        <echo message="OpenSSL was already downloaded, skipping the build step." />
                      </then>
                      <else>
                        <echo message="Downloading OpenSSL" />

                        <!-- 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" />
                          <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>
                      </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="${sslHome}" />
                      <then>
                        <echo message="OpenSSL was already build, skipping the build step." />
                      </then>
                      <else>
                        <echo message="Building OpenSSL" />
                        <mkdir dir="${sslHome}" />
                        <exec executable="Configure" failonerror="true" dir="${opensslBuildDir}" 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=${sslHome} --openssldir=${sslHome}" />
                        </exec>
                        <exec executable="make" failonerror="true" dir="${opensslBuildDir}" resolveexecutable="true">
                          <arg value="depend" />
                        </exec>
                        <exec executable="make" failonerror="true" dir="${opensslBuildDir}" resolveexecutable="true" />
                        <exec executable="make" failonerror="true" dir="${opensslBuildDir}" 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>