How can I use uploadArchives with the Java plugin?


(karthickkrishnan3101991) #1

How can I use uploadArchives with the Java plugin? how can we create a jar file with usage of mavenCentral repository?

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
sourceCompatibility = "1.6"
targetCompatibility = "1.6"
version = '1.0'
uploadArchives {
 repositories {
     mavenCentral()
   }
 }

when i run “gradle uploadArchives”, it creates ivy.xml. but, it creates a jar of only 1KB. There is nothing inside the Jar except MANIFEST.MF.