--- a/baksmali/build.gradle
+++ b/baksmali/build.gradle
@@ -39,14 +39,13 @@
 }
 
 dependencies {
-    implementation project(':util')
-    api project(':dexlib2')
-    implementation depends.guava
-    implementation depends.jcommander
-
-    testImplementation depends.junit
-    testImplementation project(':smali')
-    testImplementation depends.antlr_runtime
+    compile project(':util')
+    compile project(':dexlib2')
+    compile depends.guava
+    compile depends.jcommander
+
+    testCompile depends.junit
+    testCompile project(':smali')
 }
 
 processResources.inputs.property('version', version)
@@ -55,7 +54,7 @@
 // Build a separate jar that contains all dependencies
 task fatJar(type: Jar) {
     from sourceSets.main.output
-    from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
+    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
 
     classifier = 'fat'
 
@@ -65,39 +64,30 @@
 
     doLast {
         if (!System.getProperty('os.name').toLowerCase().contains('windows')) {
-            ant.symlink(link: file("${destinationDirectory.get()}/baksmali.jar"), resource: archivePath, overwrite: true)
+            ant.symlink(link: file("${destinationDir}/baksmali.jar"), resource: archivePath, overwrite: true)
         }
     }
 }
 tasks.getByPath('build').dependsOn(fatJar)
 
-publish {
-    publishing {
-        publications {
-            mavenJava(MavenPublication) {
-                pom {
-                    description = 'baksmali is a disassembler for dalvik bytecode'
-                    scm {
-                        url = 'https://github.com/JesusFreke/smali/tree/master/baksmali'
-                    }
-                }
+uploadArchives {
+    repositories.mavenDeployer {
+        pom.project {
+            description 'baksmali is a disassembler for dalvik bytecode'
+            scm {
+                url 'https://github.com/JesusFreke/smali/tree/master/baksmali'
             }
         }
     }
 }
 
 task proguard(type: proguard.gradle.ProGuardTask, dependsOn: fatJar) {
-    def outFile = fatJar.destinationDirectory.file(
-            "${fatJar.archiveBaseName.get()}-${fatJar.archiveVersion.get()}-small.${fatJar.archiveExtension.get()}")
+    def outFile = fatJar.destinationDir.getPath() + '/' + fatJar.baseName + '-' + fatJar.version + '-small' + '.' + fatJar.extension
 
-    injars fatJar
+    injars fatJar.archivePath
     outjars outFile
 
-    if (JavaVersion.current().isJava9Compatible()) {
-        libraryjars(System.getProperty("java.home") + "/jmods")
-    } else {
-        libraryjars(System.getProperty("java.home") + "/lib/rt.jar")
-    }
+    libraryjars "${System.properties['java.home']}/lib/rt.jar"
 
     dontobfuscate
     dontoptimize
--- a/build.gradle
+++ b/build.gradle
@@ -72,7 +72,7 @@
 def maven_release_projects = ['smali', 'baksmali', 'dexlib2', 'util']
 
 subprojects {
-    apply plugin: 'java-library'
+    apply plugin: 'java'
     apply plugin: 'idea'
 
     if (JavaVersion.current().isJava8Compatible()) {
@@ -85,11 +85,6 @@
 
     version = parent.version
 
-    java {
-        sourceCompatibility JavaVersion.VERSION_1_8
-        targetCompatibility JavaVersion.VERSION_1_8
-    }
-
     ext {
         depends = [
                 guava: 'com.google.guava:guava:27.1-android',
@@ -100,7 +95,7 @@
                 antlr: 'org.antlr:antlr:3.5.2',
                 stringtemplate: 'org.antlr:stringtemplate:3.2.1',
                 jflex_plugin: 'org.xbib.gradle.plugin:gradle-plugin-jflex:1.1.0',
-                proguard_gradle: 'net.sf.proguard:proguard-gradle:6.2.2',
+                proguard_gradle: 'net.sf.proguard:proguard-gradle:5.2.1',
                 dx: 'com.google.android.tools:dx:1.7',
                 gson: 'com.google.code.gson:gson:2.3.1',
                 jcommander: jcommanderVersion
@@ -112,74 +107,72 @@
     }
 
     if (project.name in maven_release_projects) {
-        apply plugin: 'maven-publish'
+        apply plugin: 'maven'
         apply plugin: 'signing'
 
         group = 'org.smali'
 
-        publishing {
-            publications {
-                mavenJava(MavenPublication) {
-                    artifactId = project.name
-                    from components.java
-                    versionMapping {
-                        usage('java-api') {
-                            fromResolutionOf('runtimeClasspath')
-                        }
-                        usage('java-runtime') {
-                            fromResolutionResult()
-                        }
+        task javadocJar(type: Jar, dependsOn: javadoc) {
+            classifier = 'javadoc'
+            from 'build/docs/javadoc'
+        }
+
+        task sourcesJar(type: Jar) {
+            classifier = 'sources'
+            from sourceSets.main.allJava
+        }
+
+        artifacts {
+            archives javadocJar
+            archives sourcesJar
+        }
+
+        signing {
+            required { gradle.taskGraph.hasTask('uploadArchives') }
+            sign configurations.archives
+        }
+
+        uploadArchives {
+            repositories.mavenDeployer {
+                configuration = configurations.archives
+
+                beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
+
+                if (rootProject.hasProperty('sonatypeUsername') && rootProject.hasProperty('sonatypePassword')) {
+                    repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
+                        authentication(userName: sonatypeUsername, password: sonatypePassword)
                     }
+                }
 
-                    pom {
-                        name = project.name
-                        url = 'http://smali.org'
-
-                        licenses {
-                            license {
-                                name = 'The BSD 3-Clause License'
-                                url = 'http://opensource.org/licenses/BSD-3-Clause'
-                                distribution = 'repo'
-                            }
-                        }
-                        scm {
-                            connection = 'scm:git:git://github.com/JesusFreke/smali.git'
-                            developerConnection = 'scm:git:git@github.com:JesusFreke/smali.git'
-                        }
-                        developers {
-                            developer {
-                                id = 'jesusfreke'
-                                name = 'Ben Gruver'
-                                email = 'jesusfreke@jesusfreke.com'
-                            }
+                pom.artifactId = project.name
+
+                pom.project {
+                    name project.name
+                    url 'http://smali.org'
+                    packaging 'jar'
+                    licenses {
+                        license {
+                            name 'The BSD 3-Clause License'
+                            url 'http://opensource.org/licenses/BSD-3-Clause'
+                            distribution 'repo'
                         }
                     }
-                }
-            }
-            if (rootProject.hasProperty('sonatypeUsername') && rootProject.hasProperty('sonatypePassword')) {
-                repositories {
-                    maven {
-                        url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
-                        credentials {
-                            username sonatypeUsername
-                            password sonatypePassword
+                    scm {
+                        connection 'scm:git:git://github.com/JesusFreke/smali.git'
+                        developerConnection 'scm:git:git@github.com:JesusFreke/smali.git'
+                    }
+                    developers {
+                        developer {
+                            id 'jesusfreke'
+                            name 'Ben Gruver'
+                            email 'jesusfreke@jesusfreke.com'
                         }
                     }
                 }
             }
         }
 
-        signing {
-            required { gradle.taskGraph.hasTask('publish') }
-            sign(publishing.publications["mavenJava"])
-        }
-
-        java {
-            withJavadocJar()
-            withSourcesJar()
-        }
-
-        tasks.getByPath(':release').dependsOn(publish)
+        tasks.getByPath(':release').dependsOn(uploadArchives)
     }
 }
 
@@ -193,6 +186,6 @@
 }
 
 wrapper {
-    gradleVersion = '6.8.2'
+    gradleVersion = '5.1'
     distributionType = Wrapper.DistributionType.ALL
 }
--- a/dexlib2/build.gradle
+++ b/dexlib2/build.gradle
@@ -46,11 +46,11 @@
 }
 
 dependencies {
-    implementation depends.findbugs
-    implementation depends.guava
+    compile depends.findbugs
+    compile depends.guava
 
-    testImplementation depends.junit
-    testImplementation depends.mockito
+    testCompile depends.junit
+    testCompile depends.mockito
 
     accessorTestGenerator project('accessorTestGenerator')
 
@@ -93,16 +93,12 @@
     args sourceSets.accessorTest.output.classesDirs
 }
 
-publish {
-    publishing {
-        publications {
-            mavenJava(MavenPublication) {
-                pom {
-                    description = 'dexlib2 is a library for reading/modifying/writing Android dex files'
-                    scm {
-                        url = 'https://github.com/JesusFreke/smali/tree/master/dexlib2'
-                    }
-                }
+uploadArchives {
+    repositories.mavenDeployer {
+        pom.project {
+            description 'dexlib2 is a library for reading/modifying/writing Android dex files'
+            scm {
+                url 'https://github.com/JesusFreke/smali/tree/master/dexlib2'
             }
         }
     }
--- a/smali/build.gradle
+++ b/smali/build.gradle
@@ -45,7 +45,7 @@
 configurations {
     // Remove the full antlr library that's added by the antlr plugin. We manually
     // add the smaller antlr_runtime library instead
-    implementation.exclude group: 'org.antlr', module: 'antlr'
+    compile.exclude group: 'org.antlr', module: 'antlr'
 }
 
 sourceSets {
@@ -73,14 +73,13 @@
 }
 
 dependencies {
-    implementation project(':util')
-    api project(':dexlib2')
-    implementation depends.antlr_runtime
-    implementation depends.jcommander
-    implementation depends.stringtemplate
-    implementation depends.guava
+    compile project(':util')
+    compile project(':dexlib2')
+    compile depends.antlr_runtime
+    compile depends.jcommander
+    compile depends.stringtemplate
 
-    testImplementation depends.junit
+    testCompile depends.junit
 
     antlr depends.antlr
 }
@@ -91,7 +90,7 @@
 // Build a separate jar that contains all dependencies
 task fatJar(type: Jar, dependsOn: jar) {
     from sourceSets.main.output
-    from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
+    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
 
     classifier = 'fat'
 
@@ -101,7 +100,7 @@
 
     doLast {
         if (!System.getProperty('os.name').toLowerCase().contains('windows')) {
-            ant.symlink(link: file("${destinationDirectory.get()}/smali.jar"), resource: archivePath, overwrite: true)
+            ant.symlink(link: file("${destinationDir}/smali.jar"), resource: archivePath, overwrite: true)
         }
     }
 }
@@ -119,33 +118,25 @@
     generateDir = new File(generateDir, 'org/jf/smali')
 }
 
-publish {
-    publishing {
-        publications {
-            mavenJava(MavenPublication) {
-                pom {
-                    description = 'smali is an assembler for dalvik bytecode'
-                    scm {
-                        url = 'https://github.com/JesusFreke/smali/tree/master/smali'
-                    }
-                }
+uploadArchives {
+    repositories.mavenDeployer {
+        pom.project {
+            description 'smali is an assembler for dalvik bytecode'
+            scm {
+                url 'https://github.com/JesusFreke/smali/tree/master/smali'
             }
         }
     }
 }
 
 task proguard(type: proguard.gradle.ProGuardTask, dependsOn: fatJar) {
-    def outFile = fatJar.destinationDirectory.file(
-            "${fatJar.archiveBaseName.get()}-${fatJar.archiveVersion.get()}-small.${fatJar.archiveExtension.get()}")
+    def outFile = fatJar.destinationDir.getPath() + '/' + fatJar.baseName + '-' +
+            fatJar.version + '-small' + '.' + fatJar.extension
 
-    injars fatJar
+    injars fatJar.archivePath
     outjars outFile
 
-    if (JavaVersion.current().isJava9Compatible()) {
-        libraryjars(System.getProperty("java.home") + "/jmods")
-    } else {
-        libraryjars(System.getProperty("java.home") + "/lib/rt.jar")
-    }
+    libraryjars "${System.properties['java.home']}/lib/rt.jar"
 
     dontobfuscate
     dontoptimize
@@ -158,8 +149,4 @@
     dontnote 'com.google.common.**'
 }
 
-sourcesJar {
-    duplicatesStrategy = DuplicatesStrategy.INCLUDE
-}
-
 tasks.getByPath(':release').dependsOn(proguard)
--- a/util/build.gradle
+++ b/util/build.gradle
@@ -30,23 +30,19 @@
  */
 
 dependencies {
-    implementation project(':dexlib2')
-    implementation depends.findbugs
-    implementation depends.guava
-    implementation depends.jcommander
-    testImplementation depends.junit
+    compile project(':dexlib2')
+    compile depends.findbugs
+    compile depends.guava
+    compile depends.jcommander
+    testCompile depends.junit
 }
 
-publish {
-    publishing {
-        publications {
-            mavenJava(MavenPublication) {
-                pom {
-                    description = 'This library contains random utilities used by smali/baksmali/dexlib2'
-                    scm {
-                        url = 'https://github.com/JesusFreke/smali/tree/master/util'
-                    }
-                }
+uploadArchives {
+    repositories.mavenDeployer {
+        pom.project {
+            description 'This library contains random utilities used by smali/baksmali/dexlib2'
+            scm {
+                url 'https://github.com/JesusFreke/smali/tree/master/util'
             }
         }
     }
