Use netty-jni-util via maven central (#10877)

Motivation:

netty-jni-util is now also hosted on maven central. Let's use it

Modifications:

Adjust plugins to just unpack netty-jni-util and use it

Result:

Be able to use what is in the maven cache for netty-jni-util
This commit is contained in:
Norman Maurer 2020-12-19 10:37:32 +01:00
parent 6a057338ee
commit c4a07aee40
3 changed files with 29 additions and 15 deletions

View File

@ -404,6 +404,14 @@
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-jni-util</artifactId>
<version>0.0.2.Final</version>
<classifier>sources</classifier>
<optional>true</optional>
</dependency>
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>${project.groupId}</groupId>
<artifactId>netty-dev-tools</artifactId> <artifactId>netty-dev-tools</artifactId>

View File

@ -23,7 +23,8 @@
# LIB_NAME - the name of the native library # LIB_NAME - the name of the native library
SRC_DIR = src/main/c SRC_DIR = src/main/c
UTIL_SRC_DIR = target/netty-jni-util/src/c SRC_INTERNAL_DIR = src/main/c/internal
UTIL_SRC_DIR = target/netty-jni-util
JNI_INCLUDE_DIR = $(JAVA_HOME)/include JNI_INCLUDE_DIR = $(JAVA_HOME)/include
JNI_INCLUDES = -I$(JNI_INCLUDE_DIR) -I$(JNI_INCLUDE_DIR)/$(JNI_PLATFORM) JNI_INCLUDES = -I$(JNI_INCLUDE_DIR) -I$(JNI_INCLUDE_DIR)/$(JNI_PLATFORM)
LIB = $(LIB_DIR)/$(LIB_NAME).a LIB = $(LIB_DIR)/$(LIB_NAME).a

View File

@ -37,8 +37,7 @@
<exe.archiver>ar</exe.archiver> <exe.archiver>ar</exe.archiver>
<nativeLibName>libnetty-unix-common</nativeLibName> <nativeLibName>libnetty-unix-common</nativeLibName>
<nativeIncludeDir>${project.basedir}/src/main/c</nativeIncludeDir> <nativeIncludeDir>${project.basedir}/src/main/c</nativeIncludeDir>
<jniUtilCheckoutDir>${project.build.directory}/netty-jni-util</jniUtilCheckoutDir> <jniUtilIncludeDir>${project.build.directory}/netty-jni-util/</jniUtilIncludeDir>
<jniUtilIncludeDir>${project.build.directory}/netty-jni-util/src/c</jniUtilIncludeDir>
<nativeJarWorkdir>${project.build.directory}/native-jar-work</nativeJarWorkdir> <nativeJarWorkdir>${project.build.directory}/native-jar-work</nativeJarWorkdir>
<nativeObjsOnlyDir>${project.build.directory}/native-objs-only</nativeObjsOnlyDir> <nativeObjsOnlyDir>${project.build.directory}/native-objs-only</nativeObjsOnlyDir>
<nativeLibOnlyDir>${project.build.directory}/native-lib-only</nativeLibOnlyDir> <nativeLibOnlyDir>${project.build.directory}/native-lib-only</nativeLibOnlyDir>
@ -48,30 +47,30 @@
<build> <build>
<plugins> <plugins>
<!-- Download the netty-jni-util source -->
<plugin> <plugin>
<artifactId>maven-scm-plugin</artifactId> <groupId>org.apache.maven.plugins</groupId>
<version>1.11.2</version> <artifactId>maven-dependency-plugin</artifactId>
<executions> <executions>
<!-- unpack netty-jni-util files -->
<execution> <execution>
<id>get-netty-jni-util</id> <id>unpack</id>
<phase>generate-sources</phase> <phase>generate-sources</phase>
<goals> <goals>
<goal>checkout</goal> <goal>unpack-dependencies</goal>
</goals> </goals>
<configuration> <configuration>
<checkoutDirectory>${jniUtilCheckoutDir}</checkoutDirectory> <includeGroupIds>io.netty</includeGroupIds>
<connectionType>developerConnection</connectionType> <includeArtifactIds>netty-jni-util</includeArtifactIds>
<developerConnectionUrl>scm:git:https://github.com/netty/netty-jni-util.git</developerConnectionUrl> <classifier>sources</classifier>
<scmVersion>0.0.1</scmVersion> <outputDirectory>${jniUtilIncludeDir}</outputDirectory>
<scmVersionType>tag</scmVersionType> <includes>**.h,**.c</includes>
<skipCheckoutIfExists>true</skipCheckoutIfExists> <overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<!-- Also include c files in source jar --> <!-- Also include c files in source jar -->
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
@ -462,6 +461,12 @@
</profiles> </profiles>
<dependencies> <dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-jni-util</artifactId>
<classifier>sources</classifier>
<optional>true</optional>
</dependency>
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-common</artifactId> <artifactId>netty-common</artifactId>