ivy - Using gradle with a local artifactory repository -
i new gradle , artifactory both.
what want accomplish have separate projects each project creating jar file used other projects in same application.
for example, have utility project has, wait it..., utility classes. have services project the, that's right, services. services use utilities accomplish of work.
i've spent several hours , have utility project committing artifactory repository using script:
buildscript { repositories { mavenlocal() ivy { url 'http://picard:8080/artifactory/plugins-release' } jcenter() } dependencies { classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1" } } apply plugin: 'java' apply plugin: "com.jfrog.artifactory" archivesbasename = 'heavyweight-software-util' repositories { mavencentral() ivy { url 'http://picard:8080/artifactory/plugins-release' } } dependencies { testcompile("junit:junit:4.11") } task wrapper(type: wrapper) { gradleversion = '1.8' } artifactory { contexturl = "http://picard:8080/artifactory" //the base artifactory url if not overridden publisher/resolver publish { repository { repokey = 'libs-release-local' username = 'xxxx' password = "xxxx" maven = false ivy { ivylayout = '[organization]/[module]/[revision]/[type]s/ivy-[revision].xml' artifactlayout = '[organization]/[module]/[revision]/[type]s/[module](-[classifier])-[revision].[ext]' mavencompatible = false } } } resolve { repository { repokey = 'libs-release' username = 'xxxx' password = "xxxx" maven = false ivy { ivylayout = '[organization]/[module]/[revision]/[type]s/ivy-[revision].xml' artifactlayout = '[organization]/[module]/[revision]/[type]s/[module](-[classifier])-[revision].[ext]' mavencompatible = false } } } }
when run following:
c:\users\thom\git\utility\utility>gradle artifactorypublish [buildinfo] not using buildinfo properties file build. :artifactorypublish deploying build descriptor to: http://picard:8080/artifactory/api/build build deployed. browse in artifactory under http://picard:8080/a rtifactory/webapp/builds/utility/1436807848026/2015-07-13t13:17:27.704-0400/ build successful total time: 6.874 secs
hurrah! or, thought.
because wrapped up, thought, "now how file out." looked @ links above , they're there, can't see how jar file. tried looking @ libs-release-local in tree browser, shows 0 artifacts.
here's found under build info json under build:
{ "version" : "1.0.1", "name" : "utility", "number" : "1436807848026", "type" : "gradle", "buildagent" : { "name" : "gradle", "version" : "2.4" }, "agent" : { "name" : "gradle", "version" : "2.4" }, "started" : "2015-07-13t13:17:27.704-0400", "durationmillis" : 474, "principal" : "thom", "artifactoryprincipal" : "admin", "licensecontrol" : { "runchecks" : false, "includepublishedartifacts" : false, "autodiscover" : false, "licenseviolationsrecipientslist" : "", "scopeslist" : "" }, "buildretention" : { "count" : -1, "deletebuildartifacts" : true, "buildnumbersnottobediscarded" : [ ] }, "governance" : { "blackduckproperties" : { "runchecks" : false, "includepublishedartifacts" : false, "autocreatemissingcomponentrequests" : false, "autodiscardstalecomponentrequests" : false } } }
i've googled , researched , can't seem figure out how make use of jar file have committed repository.
ok, after reading: https://docs.gradle.org/current/userguide/publishing_ivy.html , https://docs.gradle.org/current/userguide/artifact_management.html , finally, http://forums.jfrog.org/405-http-method-put-not-supported-td5786632.html have pieced answer question. have attached build script performs upload properly...
buildscript { repositories { mavenlocal() jcenter() } dependencies { classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1" } } apply plugin: 'java' apply plugin: 'ivy-publish' archivesbasename = 'heavyweight-software-util' repositories { mavencentral() ivy { url 'http://picard:8080/artifactory/plugins-release' } } dependencies { compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.+' compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.+' testcompile("junit:junit:4.11") } publishing { publications { ivy(ivypublication) { organisation 'com.heavyweightsoftware' module 'heavyweight-util' revision '1.0' components.java } } repositories { ivy { url 'http://picard:8080/artifactory/libs-release-local' credentials { username "xxxxx" password "xxxxx" } } } } task wrapper(type: wrapper) { gradleversion = '1.8' }
now know publication working correctly, should able use repository without issue.
Comments
Post a Comment