ODLPARENT-142: Don't package mysql-connector-java 58/68858/1
authorRyan Goulding <ryandgoulding@gmail.com>
Tue, 27 Feb 2018 21:26:19 +0000 (16:26 -0500)
committerStephen Kitt <skitt@redhat.com>
Wed, 28 Feb 2018 08:19:37 +0000 (08:19 +0000)
Heavy handed approach to removing mysql-connector-java artifact from
our distribution.  Karaf includes this artifact for use with its
"jdbc" feature as of [4,5).  However, it is not license friendly
(it is GPL), so we should not ship it as part of our distribution.
Since we prepopulate "system" with all of the necessary jars to
start ODL offline, this approach just deletes the artifact in the
prepare-package phase.  This means that if someone attempts to use
our base distribution w/ "jdbc", then they will get a nasty
error since mysql client classes won't exist.  If they have a use
case that allows GPL licensing, they can always deploy it using an
out of band method (i.e., hot deployment of the artifact, or copying
it into system by hand).

In the future, we should address PAXJDBC-128 as a proper fix.  This
is a stopgap measure for the meantime, since the aforementioned
solution requires a new version of pax-features-jdbc, a new version
of karaf, and a new version of odlparent.

We should additionally release-note this as a known issue with
odlparent's karaf4-parent, since some downstream distributions
likely inherit from odlparent (instead of integration/distribution),
and should be made aware that they need to disclude this file
themselves.

Change-Id: I5126f9ae8cdbe554fbb8a01dcc6af2d8deaa8939
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
Signed-off-by: Stephen Kitt <skitt@redhat.com>
karaf/pom.xml

index 20033aa6538179d795df0f3fdc7dabad9a5bceb5..776cae97e9f5caa969302ef10ee313c3890f712d 100644 (file)
                     </execution>
                 </executions>
             </plugin>
+
+            <!-- ODLPARENT-142: Heavy-handed workaround to remove mysql dependencies from system -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <delete includeemptydirs="true">
+                                    <fileset dir="${project.build.directory}/assembly/system/mysql"/>
+                                </delete>
+                            </tasks>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 </project>