Issue #2394 open

Maven deploy compatible Downloads API (BB-1106)

Mario Mueller
created an issue

It would be damn cool if you guys would implement an option to deploy maven build artifacts as downloads in a repository.

I'm hosting one of my Atlassian plugins here at bitbucket and it would be great to just call maven's deploy mechanism to add a download.

Even if it is not possible, it would be cool to upload a download via the api (so I could write a maven plugin to handle that ;) )

What do you think?

Regards, Mario

Comments (28)

  1. Erik van Zijst staff

    I think that's an excellent idea and something we thought about too!

    Ideally, we would like to make this as convenient as possible for the user. For instance, you would add the bb repo to your pom file and every version of every artifact on bb would instantly become accessible.

    However, if we would open BB as a public maven repo for users to deploy to, that might become a mess as well as a security hole (people could deploy malicious artifacts under well known and trusted group ids).

    An alternative might be to give each user his/her own maven repo under his username (e.g. https://bitbucket.org/xenji/maven). However, that would result in thousands of individual repos and would fail to leverage the community aspect.

    Maybe we could solve the problems of a large single repo by having users register group ids (effectively domain names). Bitbucket could ask you to put a specific html file on the webserver of your domain. This would prove that you control the domain and we could then allow you to deploy artifacts (the Google apps method).

    What do you think would be a good way to go about this?

    Cheers, Erik

  2. Mario Mueller reporter

    Hey Erik,

    Thank you for the fast and detailed feedback.

    I think the last point you've mentioned is the best and most secure approach. I fully agree with that.

    I'm looking forward to the release date ;)

    Regards, Mario

  3. Morten Lied Johansen

    I'd like to add a comment here to point out that the people using maven for building stuff aren't the only ones who would like to be able to script the build and release of new stuff, including uploading a finished archive of some sort to a useful download location.

    Could you make sure the API can be used by others as well, and not just people using maven?

  4. Morten Lied Johansen

    There is nothing wrong with the current downloads tab, I just wanted to make sure the API for uploading isn't tied exclusively to the needs of Maven or Java.

    It would be best if it can be used for uploading any kind of useful downloadable (binary release, windows installers etc.) related to a repo.

  5. Erik van Zijst staff

    A Maven deploy normally uses either ftp or scp to create remote directories and upload its files (http://maven.apache.org/plugins/maven-deploy-plugin/) according to maven's directory hierarchy.

    You wouldn't upload non-maven artifacts to this directory tree, so uploading custom files in a particular repo would likely remain the way it is now, independent from a possible maven repo.

    Although we don't currently offer an official api for uploading custom files, you could nevertheless just post directly to the form that is on the download page. It's a bit of a hassle because it uses one-time keys, but it can be done.

    I will raise an internal issue for adding support for custom file uploads to the REST api, so you don't have to reverse engineer the download page.

    Cheers, Erik

  6. Eddie Webb

    This would be amazing! I have found articles that suggest just creating a new branch within you project, and deploying to it as a local file repository, then pushing the whole kit-n-caboodle back to bitbucket, but that would just show up as binaries in a repo, and is not at all ideal.

    I would the only real challenge would be the conflict of structures, where as maven would prefer a nested directory structure using the GAV as various folders, and somehow translating that on the fly to a flattened structure in the downloads folder here in bitbucket. (in other words Maven would try to push a file to bb.org/user/project/downloads/project/group/name/project-artifact/project-version/project-artifact-project-version.ext but the file would really just be at bb.org/user/project/downloads/project-artifact-project-version.ext)

    Using maven to automate builds for a few Atlassian plugins, I find the lack of any public maven repository the only gap in my otherwise automated and efficient release process.

  7. Leon Moonen

    It has been a while since this was first discussed, yet it is still very much needed. Could we get an update on the status of this issue? Or could you maybe, for the time being, share a 'trusted' script that does the scraping of the session key and posts a given file in the downloads?

  8. Eddie Webb

    I ended up just hosting a simple webserver and using the SSH wagon for publishing of my artifacts to my own nexus repository. Doesn't give me the visibility that a BB hosted service would, but I can easily link to the maven repo from the wiki pages.

  9. Sorin Sbarnea

    Clearly it seems that almost everyone is looking for the same thing: a way to automate the release / publish part of build system. Obviously because SSH is already used, a solution that would use SSH would be desirable.

    Form my point of view having a secondary repository for binaries could be the best approach as it would solve most problems: easy upload, version control, tagging and authentication : anyone can automate this using few lines of bash.

  10. Log in to comment