Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the maven repository protocol?

I have been learning a lot about Maven lately and am very impressed. Where can I find information about communicating with, deploying to and retrieving from a repository in the same manner as Maven does? Is this done through some published protocol?

I have found information about OSGI (and OBR) but cannot tell if this is what I should be looking into.

I would like to do this in .net (for whatever reason). I do not mind looking through java source code if someone could point me to the correct component, but would much rather be pointed to the protocol specifications.

[EDIT] I see a lot of answers regarding HTTP. I would like to further clarify, I am not looking for the transfer protocol, I am looking for the API protocol. For example, the Simple Object Access Protocol (SOAP) uses the Hyper Text Transfer Protocol to transfer messages. What is the access protocol for Maven?

like image 336
Phillip Scott Givens Avatar asked Apr 03 '13 16:04

Phillip Scott Givens


3 Answers

As khmarbaise already said the transfer protocol is in most cases http(s), but there are other protocols available, e.g. simple file access for local repositories, WebDAV, SCP, SFTP, and so on. A maven repository is more a special directory layout. There are servers like Nexus or Artifactory that offer additional functionality like proxying remote repositories or certain checks like authentication.

https://maven.apache.org/guides/introduction/introduction-to-repositories.html

Taken from http://wiki.jfrog.org/confluence/display/rtf/repository+layouts Maven Repository Layout: [orgPath]/[module]/[baseRev](-[folderItegRev])/[module]-[baseRev](-[fileItegRev])(-[classifier]).[ext]

Example org/eclipse/jetty/jetty-ajp/7.0.2.v20100331/jetty-ajp-7.0.2.v20100331.jar

like image 166
Leonard Brünings Avatar answered Oct 07 '22 20:10

Leonard Brünings


The usual protocol is http furthermore for .net there exists already a solution which is called nuget which supports that already and works with some of the repository managers like neuxs and artifactory.

Ah...Maven uses it's own protocol. No SOAP etc. May be a look here will help a little bit. And furthermore this.

Update You can simply download an artifact from a Maven repository by wget ...which is simply a http-get operation. To uplodate an artifact is simply a http-put ...you can do this by curl.

like image 26
khmarbaise Avatar answered Oct 07 '22 21:10

khmarbaise


Strictly, there is no special access protocol for Maven. Maven uses plain HTTP to get artifacts from repository. Repository should have special layout, i.e. URL structure (which simply projected to usual directory structure). You can organize your own repo simply by organizing directories in a special way: [orgPath]/[module]/[baseRev](-[folderItegRev])/[module]-[baseRev](-[fileItegRev])(-[classifier]).[ext] without any special software on server side.

So, it is more about directory structure than special protocol. Very simple and working approach.

Of course, if you wanna additional services around it (like search, access control, stats etc) you should do it yourself. That's what JFrog does with its Artifactory product.

like image 45
iryndin Avatar answered Oct 07 '22 20:10

iryndin