gradle-aem-plugin icon indicating copy to clipboard operation
gradle-aem-plugin copied to clipboard

Reduce number of plugin dependencies

Open pun-ky opened this issue 7 years ago • 7 comments

To make plugin more compatible with others. (protect against resolved dependencies runtime incompatibility)

For instance there are two libraries set for zipping: zip4j and ziputil (zeroturnaround). Usages of ziputil need to be replaced by zipfile from zip4j.

Pebble template engine and other non-standard deps could be even embedded under internal package in a same way as it is Gradle doing, see sshj classes under com.gradle.internal.deps.org.schmidt.sshj (?)

pun-ky avatar Jan 23 '19 10:01 pun-ky

https://code.google.com/archive/p/jarjar/

pun-ky avatar Feb 27 '19 17:02 pun-ky

this is because when some build script user will use AEM Plugin and other Plugin simultenously, then Gradle will negotatiate/ choose more recent version from these two which could not be runtime compatible. I have already such problem with Pebble Template Engine. Pebble helpers in 2.x have another interface signature in 3.x which caused a problem with build with Fork Plugin containing defined Pebble 2 and AEM Plugin containing Pebble 3 defined.

pun-ky avatar Apr 25 '19 06:04 pun-ky

try removing dependency to commons IO / e.g IOUtils.toString replace with Kotlin extension function InputStream.readText() / or buffering version input.bufferedReader().use { it.readText() }

pun-ky avatar Jul 30 '19 05:07 pun-ky

sh gradlew dependencies --configuration=implementation

> Task :dependencies

------------------------------------------------------------
Root project - Gradle AEM Plugin
------------------------------------------------------------

implementation - Implementation only dependencies for compilation 'main' (target  (jvm)). (n)
+--- unspecified (n)
+--- org.jetbrains.kotlin:kotlin-stdlib:1.3.60 (n)
+--- org.jetbrains.kotlin:kotlin-reflect:1.3.60 (n)
+--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.0 (n)
+--- org.apache.commons:commons-lang3:3.4 (n)
+--- commons-io:commons-io:2.4 (n)
+--- commons-validator:commons-validator:1.6 (n)
+--- com.fasterxml.jackson.module:jackson-module-kotlin:2.10.0 (n)
+--- org.reflections:reflections:0.9.9 (n)
+--- org.apache.jackrabbit.vault:vault-cli:3.2.4 (n)
+--- org.jsoup:jsoup:1.10.3 (n)
+--- org.samba.jcifs:jcifs:1.3.18-kohsuke-1 (n)
+--- biz.aQute.bnd:biz.aQute.bnd.gradle:4.2.0 (n)
+--- org.zeroturnaround:zt-zip:1.11 (n)
+--- net.lingala.zip4j:zip4j:1.3.2 (n)
+--- org.apache.sshd:sshd-sftp:2.2.0 (n)
+--- org.apache.httpcomponents:httpclient:4.5.4 (n)
+--- org.apache.httpcomponents:httpmime:4.5.4 (n)
+--- org.osgi:org.osgi.core:6.0.0 (n)
+--- io.pebbletemplates:pebble:3.0.4 (n)
+--- com.dorkbox:Notify:3.7 (n)
+--- com.jayway.jsonpath:json-path:2.4.0 (n)
+--- org.buildobjects:jproc:2.2.3 (n)
\--- net.adamcin.oakpal:oakpal-core:1.5.1 (n)

(n) - Not resolved (configuration is not meant to be resolved)

pun-ky avatar Dec 10 '19 13:12 pun-ky

e.g needed to avoid

dependencies {
    "implementation"("com.cognifide.gradle:aem-plugin:9.2.1")
    constraints {
        "implementation"("com.google.guava:guava:23.0") {
            because("version from gradle-aem-plugin breaks robot framework")
        }
    }

as of guava is very often incompatible between each version

pun-ky avatar Dec 10 '19 13:12 pun-ky

org.reflections to be removed as of it uses old guava / 15.

pun-ky avatar Apr 07 '20 11:04 pun-ky

guava removed by removing reflections, jackrabbit removed by removing vault and oakpal dependencies in 13.0.0;

TODO:

  • remove commons-io and commons-lang3
  • jarjar: pebble, sshd, jcifs/smb

pun-ky avatar Apr 17 '20 18:04 pun-ky