-
Notifications
You must be signed in to change notification settings - Fork 143
gradle 5.1 fails #80
Comments
Is this project still active? Whole stacktrace:
|
I don't work with Android projects anymore and haven't for years. I've always intended to keep the maintenance of the plugin, however gradle makes it harder and harder to do it. Recently they modified a lot the gradle build, mixing kotlin and groovy and it breaks everything I've done. I might find the time and do it, but it would probably be safer to find an alternative plugin (if one exists) or do it differently (using the maven-publish plugin for example). Whatever you find, please let me know, I'll update the main readme so other people are aware of other options. |
I can look at it and send you a pull request. But you have right that for the future will be better to found a different way. |
I wonder why maven uploadArchives target never had any issues. Maybe next plugin should be based on maven uploadArchives task. At least that where I'll start looking. |
I asked also here if there is any other more official (suggested by Google team) how to do it I'm using this plugin successfully for several years already and I did not search different ways until now. |
I guess the official way of publishing will be this https://docs.gradle.org/current/userguide/publishing_overview.html -> for Maven https://docs.gradle.org/current/userguide/publishing_maven.html From what I see, android-maven-gradle-plugin is based on https://docs.gradle.org/current/userguide/maven_plugin.html that in the documentation states that:
That being said, in the past I used |
As I remember it always been there but never works with android libraries. You can see it propose 'id java-library' and fails with 'com.android.library'. Maybe you can somehow create example with 'com.android.library' |
This small library https://github.com/xrubioj/SecureControls I created is uploaded to JFrog using Let me try to create a smaller example with just |
// https://docs.gradle.org/current/userguide/publishing_maven.html
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(project.android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
def prop(String name) {
project.hasProperty(name) ? project.getProperty(name) : null
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId 'com.github.axet'
artifactId 'android-library'
version android.defaultConfig.versionName
project.afterEvaluate {
artifact bundleReleaseAar
}
artifact sourcesJar
artifact javadocJar
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'Android Library'
description = 'Android Simple Widgets and Support classes.'
url = 'https://gitlab.com/axet/android-library'
licenses {
license {
name = 'GNU LESSER GENERAL PUBLIC LICENSE 3.0'
url = 'http://www.gnu.org/copyleft/lesser.html'
}
}
developers {
developer {
id = 'axet'
name = 'Alexey Kuznetsov'
email = 'axet@me.com'
}
}
scm {
connection = 'scm:git:https://gitlab.com/axet/android-library'
developerConnection = 'scm:git:https://gitlab.com/axet/android-library'
url = 'https://gitlab.com/axet/android-library'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username prop('ossrhUsername')
password prop('ossrhPassword')
}
}
}
}
signing {
sign publishing.publications.mavenJava
} EDIT: not listing dependencies in pom.xml |
I found something: https://github.com/wupdigital/android-maven-publish Just replace example above: project.afterEvaluate {
artifact bundleReleaseAar
} with: from components.android And components are: buildscript {
dependencies {
classpath 'digital.wup:android-maven-publish:3.6.2'
}
}
apply plugin: 'digital.wup.android-maven-publish' // 'gradle publishToMavenLocal' 'publish' tasks I guess it is closed for now. |
Thank you @dcendents for all the effort you put in maintaining this plugin until now! For Gradle 5.x it's now possible to use https://github.com/sky-uk/gradle-maven-plugin which solves the problems and uses new APIs |
I ran into the same issue while building https://github.com/material-components/material-components-android I tried https://github.com/sky-uk/gradle-maven-plugin, got another error: Eventually, I found the official maven plugin https://docs.gradle.org/current/userguide/maven_plugin.html#uploading_to_maven_repositories. It works for me, though there is a small issue on the web page. My environment: Gradle 5.5.1, Kotlin 1.3.41, Apache Maven 3.6.0, Java version: 1.8.0_212, Android studio 3.4.2 My fix is here shaohua-deng/material-components-android@f163437 |
I started using https://github.com/wupdigital/android-maven-publish and it works very well. |
New issue with gradle 5.1
The text was updated successfully, but these errors were encountered: