1

Is it possible to add and pull files from a sonatype nexus repo using the command line ?

I'm looking at storing the source dir (tarballs and all) of a rpm build environment, and i've been told there's a nexus file repo locally available to do it.

However i've never encountered nexus before so i've no idea how to interact with it. From what i can tell its for java projects, but if it can do the job then im happy enough.

I was kind of hoping i could just rsync the files into a particular dir and nexus will make them known via its web interface.

Sirex
  • 219
  • 4
  • 22
  • Hi there. I think nexus/maven is an inappropriate tool for what you've described. Nexus stores packages & sources as 'jars', which are java-specific, and maven itself has minimal support for building rpms. Something like `yum` or `zypper` would be far better suited to rpm distribution. – laher May 07 '12 at 01:09
  • ok. that's more or less what i suspected. its actually the tarballs used for creating rpm's that im looking at storing. – Sirex May 07 '12 at 03:15
  • amir75 ..while the original use was storing jars in the repository expected by Maven this has not be true for a long time and Nexus is a great tool for storing any binary artifacts at this stage. – Manfred Moser May 09 '12 at 04:20

2 Answers2

2

Check this answer:

It's possible to put binary files on nexus repository?

The Maven command-line can be used to upload files and once uploaded they can be retrieved using a standard HTTP request.

The Nexus GUI also has a mechanism for a web based file upload.

Community
  • 1
  • 1
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
0

For a rpm build environment I would suggest you take a look at the Nexus Yum Plugin. It can expose a repository in Nexus as a Yum repository hosting RPM packages. More documentation is on the site.

In terms of interacting with Nexus it is a just based around a set of REST API's and http requests. So you can script it with anything including bash and so on. Or you could write your own plugin as well.

In general Nexus has support for all sorts of artifacts with specific support for .net/NuGet, Eclipse Update Sites (P2), OSGI, Maven sites and of course Maven2 and Maven 1. But as you can see it can be expanded via plugin. I would love for someone to write a plugin that can expose Nexus as an apt-deb/deb repo.

All of this is documented in the free book about Nexus.

Disclaimer: I do Nexus related training and did some recent updates on the book.

Manfred Moser
  • 29,539
  • 13
  • 92
  • 123
  • its actually tarballs i'd be storing, but they are the source files in the rpm specs. I'll look into the rest of your answer asap. – Sirex May 09 '12 at 03:57