Hello! I am trying to publish an Android sdk on a...
# gradle
a
Hello! I am trying to publish an Android sdk on a local repository using maven-publish plugin, I want to exclude the sources jar from the list of artifacts that are published. here is my publish-module.gradle file.
Copy code
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'

group = PUBLISH_GROUP_ID
version = PUBLISH_VERSION

afterEvaluate {
  publishing {
    publications {
      release(MavenPublication) {
        groupId PUBLISH_GROUP_ID
        artifactId PUBLISH_ARTIFACT_ID
        version PUBLISH_VERSION

        if (project.plugins.findPlugin("com.android.library")) {
          from components.release
        }

        pom {
          name = PUBLISH_ARTIFACT_ID
          description = PUBLISH_ARTIFACT_DESC
          url = "<https://www.developer.com>"
          licenses {
            license {
              name = "The Apache Software License, Version 2.0"
              url = "<http://www.apache.org/licenses/LICENSE-2.0.txt>"
            }
          }
          developers {
            developer {
              id = "dev"
              name = "Developer"
              email = "dev@developer.com"
            }
          }
        }
      }
    }
  }
}


// Load properties from local.properties or environment variables
Properties artifactoryProperties = new Properties()
def afUser
def afPass

if (project.rootProject.file('local.properties').exists()) {
  artifactoryProperties.load(project.rootProject.file('local.properties').newDataInputStream())
  afUser = artifactoryProperties.get('af.user')
  afPass = artifactoryProperties.get('af.pass')
} else {
  afUser = System.getenv('AF_USER')
  afPass = System.getenv('AF_PASS')
}

artifactory {
  publish {
    //The base Artifactory URL if not overridden by the publisher/resolver
    contextUrl = '<https://my/artifactory>'
    repository {
      repoKey = 'android-repo'
      username = afUser
      password = afPass
    }
    defaults {
      //If you'd like to deploy the artifacts from all the publications defined in the Gradle script, you can set the 'ALL_PUBLICATIONS' string, instead of the publication names.
      publications ('ALL_PUBLICATIONS')
    }
  }
}
Please suggest
not kotlin but kotlin colored 1
v
This question is off-topic here. Please always consider channel and server topics. 😉