Repository: netty/netty
Issue: Netty depends on GraalVM which is under GPL license

### Netty version
4.1.63.Final

Because Netty started to [depend](https://github.com/netty/netty/blob/netty-4.1.63.Final/common/pom.xml#L42) on [GraalVM](https://search.maven.org/artifact/com.oracle.substratevm/svm/19.2.1/jar) under GPL license, although only annotations are used, we can not update netty version in our internal repository with exactly the same source code and its dependency's source code.

Is it possible not to use those annotations in the source code?



Issue comments:
@dapengzhang0 ouch... that slipped through. Let me take care. 
@pmlopes @vietj any idea on how to remove the usage of the annotations and just do everything with config files etc ?
Also @trustin 
@normanmaurer Oracle changed the artifact coordinates of the artifacts to https://search.maven.org/artifact/org.graalvm.nativeimage/svm/21.1.0/jar it seems these ones are licensed under GPL2 + Classpath Exception. 

And the sdk one is licensed under the Universal Permissive Licence 1.0.

I'm not sure which one would be best. The annotations are only needed for substitution classes, the remaining configuration can be done using property files only.

Perhaps a new review of which substitutions are in use should be done and we could try to see if they're still needed or we can achieve the same with just property config.
@pmlopes I have basically 0 % knowledge of graal / svm so I am a bit lost what to do... I think if we cant figure stuff out we may just need to remove the whole substitution stuff.


That said I was also wondering if it is a license problem at all as it is a "provided" dependency and so 100 % optional, but I am not a lawyer so 🤷 
So, I had a look at the usages and if we were to apply the patch:

```patch
diff --git a/common/pom.xml b/common/pom.xml
index 8c9fd060b6..f812999b52 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -39,7 +39,7 @@
 
   <dependencies>
     <dependency>
-      <groupId>com.oracle.substratevm</groupId>
+      <groupId>org.graalvm.nativeimage</groupId>
       <artifactId>svm</artifactId>
       <version>${graalvm.version}</version>
       <!-- Provided scope as it is only needed for compiling the SVM substitution classes -->
diff --git a/pom.xml b/pom.xml
index 6a13ce1f6a..bc6118e9f2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -495,7 +495,7 @@
     <skipAutobahnTestsuite>false</skipAutobahnTestsuite>
     <skipHttp2Testsuite>false</skipHttp2Testsuite>
     <skipJapicmp>false</skipJapicmp>
-    <graalvm.version>19.2.1</graalvm.version>
+    <graalvm.version>19.3.6</graalvm.version>
     <brotli4j.version>1.4.2</brotli4j.version>
     <!-- By default skip native testsuite as it requires a custom environment with graalvm installed -->
     <skipNativeImageTestsuite>true</skipNativeImageTestsuite>
diff --git a/testsuite-native-image-client/pom.xml b/testsuite-native-image-client/pom.xml
index 3aeee97540..bc752c24a7 100644
--- a/testsuite-native-image-client/pom.xml
+++ b/testsuite-native-image-client/pom.xml
@@ -65,7 +65,7 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>com.oracle.substratevm</groupId>
+        <groupId>org.graalvm.nativeimage</groupId>
         <artifactId>native-image-maven-plugin</artifactId>
         <version>${graalvm.version}</version>
         <executions>
```

This would make the change the license from GPL2 to GPL2+CE http://openjdk.java.net/legal/gplv2+ce.html (which by the way is the same as the OpenJDK, but I make your words, mine too, I'm not a lawyer).

About going the extra mile and get rid of the annotations, it would be possible but it means some (maybe large) refactoring in `netty-common`, the affected classes are:

* NetUtil
* CleanerJava6
* PlatformDependent0
* PlatformDependent
* UnsafeRefArrayAccess (shaded jctools)

@pmlopes this sounds like all we need (I think)... Can you open a PR for it so we get the attribution right ?

Pull request review comments:

Patch that resolved the issue:
diff --git a/common/pom.xml b/common/pom.xml
index 8c9fd060b63..f812999b52f 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -39,7 +39,7 @@
 
   <dependencies>
     <dependency>
-      <groupId>com.oracle.substratevm</groupId>
+      <groupId>org.graalvm.nativeimage</groupId>
       <artifactId>svm</artifactId>
       <version>${graalvm.version}</version>
       <!-- Provided scope as it is only needed for compiling the SVM substitution classes -->
diff --git a/pom.xml b/pom.xml
index 6a13ce1f6a7..bc6118e9f26 100644
--- a/pom.xml
+++ b/pom.xml
@@ -495,7 +495,7 @@
     <skipAutobahnTestsuite>false</skipAutobahnTestsuite>
     <skipHttp2Testsuite>false</skipHttp2Testsuite>
     <skipJapicmp>false</skipJapicmp>
-    <graalvm.version>19.2.1</graalvm.version>
+    <graalvm.version>19.3.6</graalvm.version>
     <brotli4j.version>1.4.2</brotli4j.version>
     <!-- By default skip native testsuite as it requires a custom environment with graalvm installed -->
     <skipNativeImageTestsuite>true</skipNativeImageTestsuite>


Test patch:
diff --git a/testsuite-native-image-client-runtime-init/pom.xml b/testsuite-native-image-client-runtime-init/pom.xml
index aaf9bf623f8..c29f9e2e116 100644
--- a/testsuite-native-image-client-runtime-init/pom.xml
+++ b/testsuite-native-image-client-runtime-init/pom.xml
@@ -59,7 +59,7 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>com.oracle.substratevm</groupId>
+        <groupId>org.graalvm.nativeimage</groupId>
         <artifactId>native-image-maven-plugin</artifactId>
         <version>${graalvm.version}</version>
         <executions>
diff --git a/testsuite-native-image-client/pom.xml b/testsuite-native-image-client/pom.xml
index 3aeee97540e..bc752c24a7f 100644
--- a/testsuite-native-image-client/pom.xml
+++ b/testsuite-native-image-client/pom.xml
@@ -65,7 +65,7 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>com.oracle.substratevm</groupId>
+        <groupId>org.graalvm.nativeimage</groupId>
         <artifactId>native-image-maven-plugin</artifactId>
         <version>${graalvm.version}</version>
         <executions>
diff --git a/testsuite-native-image/pom.xml b/testsuite-native-image/pom.xml
index 57b694b792a..3647de6923d 100644
--- a/testsuite-native-image/pom.xml
+++ b/testsuite-native-image/pom.xml
@@ -80,7 +80,7 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>com.oracle.substratevm</groupId>
+        <groupId>org.graalvm.nativeimage</groupId>
         <artifactId>native-image-maven-plugin</artifactId>
         <version>${graalvm.version}</version>
         <executions>