In a gradle plugin, how do I replace maven plugin 'uploadArchives' with artifactory plugin 'artifactoryPublish'? -
yes, need apply both 'maven' , 'artifactory' plugins. however, there many, many existing jenkins jobs explicitly call 'uploadarchives' (supplied maven plugin). override in own plugin force call 'artifactorypublish' when 'uploadarchives' used.
i want programmatically in plugin, rather changing hundreds of build.gradle files, , have tried every combination of calls can think of no luck far.
the last caveat has work gradle 2.4 @ minimum, gradle wrapper being used , several different versions of gradle invoked on set of builds.
anyone have idea on how accomplish this?
here's latest thing tried:
project.gettasks().replace('uploadarchives', mytask)
although constructor called (verified println message), task never called (verified adding explicit 'throw' statement , never seeing exception).
just clarify...
i want override uploadarchives 3 main reasons:
many existing jobs (as programmer's fingers) uploadarchives programmed in.
we want info artifactorypublish creates , uploads, if done via jenkins plugin, jenkins job number, etc.
we not want using plain uploadarchives , publishing without build info.
i found answer myself... it's not straightforward, work wished, except output line uploadarchives during build.
project.plugins.apply('com.jfrog.artifactory') project.gettasks().create([name: 'uploadarchives', type: myoverridetask, overwrite: true, dependson: ['artifactorypublish'] string[], group: 'upload']) yes, have disabled uploadarchives after making depend on artifactorypublish, instead of printing 'uploadarchives' during build, prints 'uploadarchives [skipped]', , didn't want there confusion.
Comments
Post a Comment