Gradle: How to upload custom JAR file to Maven repository

Viewed 14182

I build a jar file without using Gradle Jar task (I need to be using Ant task for that inside my task). How do I configure uploadArchives to be able to install JAR in specified repository.

I have tried to override default artifact with

uploadArchives {
    repositories {
        mavenDeployer {
            // some Maven configuration
        }
    }
}

artifacts {
    archives file: file('bin/result.jar')
}

but I'm getting an error that there may not be 2 artifacts with the same type and classifier, which means this configuration adds rather that overrides configuration.

1 Answers
Related