PHOENIX-7288 Add unshaded connector JARs to connectors assembly (#131)

- also add new assembly artifact containing only the unshaded JARs
- remove skip-phoenix5 build property
- add skip-shaded-assembly build property
diff --git a/phoenix5-connectors-assembly/pom.xml b/phoenix5-connectors-assembly/pom.xml
index ed8a56d..c3f843c 100644
--- a/phoenix5-connectors-assembly/pom.xml
+++ b/phoenix5-connectors-assembly/pom.xml
@@ -43,19 +43,11 @@
     </dependency>
     <dependency>
       <groupId>org.apache.phoenix</groupId>
-      <artifactId>phoenix5-hive-shaded</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.phoenix</groupId>
       <artifactId>phoenix5-spark</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.phoenix</groupId>
-      <artifactId>phoenix5-spark-shaded</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.phoenix</groupId>
-      <artifactId>phoenix5-spark3-shaded</artifactId>
+      <artifactId>phoenix5-spark3</artifactId>
     </dependency>
   </dependencies>
 
@@ -73,6 +65,26 @@
             </goals>
             <configuration>
               <executable>ln</executable>
+              <workingDirectory>${project.basedir}/../phoenix5-hive/target</workingDirectory>
+              <arguments>
+                <argument>-fnsv</argument>
+                <argument>
+                  phoenix5-hive-${project.version}.jar
+                </argument>
+                <argument>
+                  phoenix5-hive.jar
+                </argument>
+              </arguments>
+            </configuration>
+          </execution>
+          <execution>
+            <id>hive-shaded without version</id>
+            <phase>package</phase>
+            <goals>
+              <goal>exec</goal>
+            </goals>
+            <configuration>
+              <executable>ln</executable>
               <workingDirectory>${project.basedir}/../phoenix5-hive-shaded/target</workingDirectory>
               <arguments>
                 <argument>-fnsv</argument>
@@ -93,6 +105,26 @@
             </goals>
             <configuration>
               <executable>ln</executable>
+              <workingDirectory>${project.basedir}/../phoenix5-spark/target</workingDirectory>
+              <arguments>
+                <argument>-fnsv</argument>
+                <argument>
+                  phoenix5-spark-${project.version}.jar
+                </argument>
+                <argument>
+                  phoenix5-spark.jar
+                </argument>
+              </arguments>
+            </configuration>
+          </execution>
+          <execution>
+            <id>spark-shaded without version</id>
+            <phase>package</phase>
+            <goals>
+              <goal>exec</goal>
+            </goals>
+            <configuration>
+              <executable>ln</executable>
               <workingDirectory>${project.basedir}/../phoenix5-spark-shaded/target</workingDirectory>
               <arguments>
                 <argument>-fnsv</argument>
@@ -106,7 +138,7 @@
             </configuration>
           </execution>
           <execution>
-            <id>spark3 without version</id>
+            <id>spark3-shaded without version</id>
             <phase>package</phase>
             <goals>
               <goal>exec</goal>
@@ -124,7 +156,27 @@
                 </argument>
               </arguments>
             </configuration>
-          </execution>          
+          </execution>
+          <execution>
+            <id>spark3 without version</id>
+            <phase>package</phase>
+            <goals>
+              <goal>exec</goal>
+            </goals>
+            <configuration>
+              <executable>ln</executable>
+              <workingDirectory>${project.basedir}/../phoenix5-spark3/target</workingDirectory>
+              <arguments>
+                <argument>-fnsv</argument>
+                <argument>
+                  phoenix5-spark3-${project.version}.jar
+                </argument>
+                <argument>
+                  phoenix5-spark3.jar
+                </argument>
+              </arguments>
+            </configuration>
+          </execution>
         </executions>
       </plugin>
       <plugin>
@@ -137,7 +189,7 @@
               <goal>single</goal>
             </goals>
             <configuration>
-              <skipAssembly>${skip-phoenix5}</skipAssembly>
+              <skipAssembly>${skip-shaded-assembly}</skipAssembly>
               <descriptors>
                 <descriptor>src/build/package-phoenix5-connectors-to-tar-all.xml</descriptor>
               </descriptors>
@@ -146,8 +198,45 @@
               <appendAssemblyId>false</appendAssemblyId>
             </configuration>
           </execution>
+          <execution>
+            <id>package-phoenix5-unshaded-to-tar</id>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+            <configuration>
+              <descriptors>
+                <descriptor>src/build/package-phoenix5-connectors-to-tar-unshaded.xml</descriptor>
+              </descriptors>
+              <tarLongFileMode>posix</tarLongFileMode>
+            </configuration>
+          </execution>
         </executions>
       </plugin>
     </plugins>
   </build>
+  <profiles>
+    <profile>
+      <id>shaded-assembly</id>
+      <activation>
+        <property>
+          <name>!skip-shaded-assembly</name>
+        </property>
+      </activation>
+      <dependencies>
+        <dependency>
+          <groupId>org.apache.phoenix</groupId>
+          <artifactId>phoenix5-hive-shaded</artifactId>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.phoenix</groupId>
+          <artifactId>phoenix5-spark-shaded</artifactId>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.phoenix</groupId>
+          <artifactId>phoenix5-spark3-shaded</artifactId>
+        </dependency>
+      </dependencies>
+    </profile>
+  </profiles>
 </project>
diff --git a/phoenix5-connectors-assembly/src/build/components/phoenix5-jars.xml b/phoenix5-connectors-assembly/src/build/components/phoenix5-jars.xml
index ac02e2f..2cbd49a 100644
--- a/phoenix5-connectors-assembly/src/build/components/phoenix5-jars.xml
+++ b/phoenix5-connectors-assembly/src/build/components/phoenix5-jars.xml
@@ -22,27 +22,27 @@
 <component>
   <fileSets>
     <fileSet>
-      <directory>${project.basedir}/../phoenix5-spark-shaded/target</directory>
+      <directory>${project.basedir}/../phoenix5-spark/target</directory>
       <outputDirectory>/</outputDirectory>
       <includes>
-        <include>phoenix5-spark-shaded-${project.version}.jar</include>
-        <include>phoenix5-spark-shaded.jar</include>
+        <include>phoenix5-spark-${project.version}.jar</include>
+        <include>phoenix5-spark.jar</include>
       </includes>
     </fileSet>
     <fileSet>
-      <directory>${project.basedir}/../phoenix5-spark3-shaded/target</directory>
+      <directory>${project.basedir}/../phoenix5-spark3/target</directory>
       <outputDirectory>/</outputDirectory>
       <includes>
-        <include>phoenix5-spark3-shaded-${project.version}.jar</include>
-        <include>phoenix5-spark3-shaded.jar</include>
+        <include>phoenix5-spark3-${project.version}.jar</include>
+        <include>phoenix5-spark3.jar</include>
       </includes>
     </fileSet>
     <fileSet>
-      <directory>${project.basedir}/../phoenix5-hive-shaded/target</directory>
+      <directory>${project.basedir}/../phoenix5-hive/target</directory>
       <outputDirectory>/</outputDirectory>
       <includes>
-        <include>phoenix5-hive-shaded-${project.version}.jar</include>
-        <include>phoenix5-hive-shaded.jar</include>
+        <include>phoenix5-hive-${project.version}.jar</include>
+        <include>phoenix5-hive.jar</include>
       </includes>
     </fileSet>
   </fileSets>
diff --git a/phoenix5-connectors-assembly/src/build/components/phoenix5-shaded-jars.xml b/phoenix5-connectors-assembly/src/build/components/phoenix5-shaded-jars.xml
new file mode 100644
index 0000000..ac02e2f
--- /dev/null
+++ b/phoenix5-connectors-assembly/src/build/components/phoenix5-shaded-jars.xml
@@ -0,0 +1,49 @@
+<?xml version='1.0'?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF 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.
+
+-->
+<component>
+  <fileSets>
+    <fileSet>
+      <directory>${project.basedir}/../phoenix5-spark-shaded/target</directory>
+      <outputDirectory>/</outputDirectory>
+      <includes>
+        <include>phoenix5-spark-shaded-${project.version}.jar</include>
+        <include>phoenix5-spark-shaded.jar</include>
+      </includes>
+    </fileSet>
+    <fileSet>
+      <directory>${project.basedir}/../phoenix5-spark3-shaded/target</directory>
+      <outputDirectory>/</outputDirectory>
+      <includes>
+        <include>phoenix5-spark3-shaded-${project.version}.jar</include>
+        <include>phoenix5-spark3-shaded.jar</include>
+      </includes>
+    </fileSet>
+    <fileSet>
+      <directory>${project.basedir}/../phoenix5-hive-shaded/target</directory>
+      <outputDirectory>/</outputDirectory>
+      <includes>
+        <include>phoenix5-hive-shaded-${project.version}.jar</include>
+        <include>phoenix5-hive-shaded.jar</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+</component>
diff --git a/phoenix5-connectors-assembly/src/build/package-phoenix5-connectors-to-tar-all.xml b/phoenix5-connectors-assembly/src/build/package-phoenix5-connectors-to-tar-all.xml
index 867fd87..2399a00 100644
--- a/phoenix5-connectors-assembly/src/build/package-phoenix5-connectors-to-tar-all.xml
+++ b/phoenix5-connectors-assembly/src/build/package-phoenix5-connectors-to-tar-all.xml
@@ -33,5 +33,6 @@
 
   <componentDescriptors>
     <componentDescriptor>src/build/components/phoenix5-jars.xml</componentDescriptor>
+    <componentDescriptor>src/build/components/phoenix5-shaded-jars.xml</componentDescriptor>
   </componentDescriptors>
 </assembly>
\ No newline at end of file
diff --git a/phoenix5-connectors-assembly/src/build/package-phoenix5-connectors-to-tar-unshaded.xml b/phoenix5-connectors-assembly/src/build/package-phoenix5-connectors-to-tar-unshaded.xml
new file mode 100644
index 0000000..659e841
--- /dev/null
+++ b/phoenix5-connectors-assembly/src/build/package-phoenix5-connectors-to-tar-unshaded.xml
@@ -0,0 +1,37 @@
+<?xml version='1.0'?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF 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.
+
+-->
+
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+  <!--This 'all' id is not appended to the produced bundle because we do this: http://maven.apache.org/plugins/maven-assembly-plugin/faq.html#required-classifiers -->
+  <id>unshaded-only</id>
+  <formats>
+    <format>tar.gz</format>
+  </formats>
+  <includeBaseDirectory>true</includeBaseDirectory>
+
+
+  <componentDescriptors>
+    <componentDescriptor>src/build/components/phoenix5-jars.xml</componentDescriptor>
+  </componentDescriptors>
+</assembly>
\ No newline at end of file