Uploading and downloading ZIP file from Artifactory

I am writing JavaScript code and my JavaScript code is dependent on other JavaScript files which are zipped and available in Artifactory. I am planning to write extension and use something like

myJSDependencies {
   js name:'libA', version:'1.0'
   js name:'libB', version:'2.0'
     }

The above will download libA.zip with version 1.0 and download libB.zip with version 2.0. Then extracts all the JS files from zip files.

  1. Is there a way to specifies the dependency as zip files? I currently see the option to specify dependency on jar and war. 2. Is there a way of uploading zip file to artifactory? I currently see the option of uploading jar and war.

Regards, Pranav

You can download and upload any kind of file from and to Artifactory.

For downloads, you need to specify the ‘ext’ type in dependency declaration, as described in Chapter 43 of the user guide.

For uploads, add your files to ‘archives’ configuration, as described in Chapter 44 of the user guide.

Hope that helps, Baruch

Thanks Baruch. Since I am working on JavaScript project, I do not want to use ‘java’ plugin and hence do not want to specify runtime or compile dependencies. I want to write my own ‘JavaScript’ plugin and closure like

myJSDependencies {
   js group: 'com.xx', name:'libA', version:'1.0'
   js group: 'com.yy', name:'libB', version:'2.0'
     }

How do I achieve it?

Regards, Pranav

You don’t need the java plugin, nor the runtime or compile dependencies. As the documentation suggests, you should create your own configuration (named ‘js’, as I can see).

Thanks Baruch, great stuff to learn here.

I am also new to Artifactory storage mechanism and I worked mostly to store EAR, JAR, and WAR into Artifactory. Recently I have start to have some JavaScript development. So would also like to see if we can leverage to have dependency control on JavaScript. Thanks in advance