Usage of Hosted repo's in Nexus - repository

I need to use hosted repo's in nexus, in order to pull all the dependencies from the nexus. I have dependencies from different sources but I need all the dependencies pulled from nexus. I have created one hosted repo, but when I click the URL it shows
"This maven2 hosted repository is not directly browseable at this
URL.
Please use the component browser or asset browser to inspect the
contents of this repository."
Can you please explain descriptive steps to use host repo's in order to pull all the dependencies from the nexus.
Thanks in advance

First you need to upload to the hosted repository all the dependencies you want to pull with the command mvn deploy as mentioned here - Guide to deploying 3rd party JARs to remote repository.
When you done to upload all your dependencies you can browse your components throught the UI in the Search Components box on the top. You can't browse the components in your repository from the url at this moment.

Related

How to copy/clone a maven2 repository server

I want to create a local maven2 repository so we can download dependencies faster.
we use sbt
what is the simplest way to take all or some depedencies from http://oss.sonatype.org/content/repositories/releases and put it in our server
I was thinking of a script to download some jars and put it in a sftp server and use sftp resolver with sbt
https://github.com/harrah/xsbt/wiki/Resolvers
A pretty simple way would be to install a repository manager. A popular one is Sonatype Nexus (the application that serves http://oss.sonatype.org). The repository manager is installed on your server, and set up to proxy online Maven repositories. Then you download your dependencies from the repository manager as though it was the actual server. The first time you download a dependency, it'll be as slow as before (the proxy will download it from the internet), but after that, it'll serve its cached copy. There are some details on this question.

Setup a shared ivy repository

I am setting up an ant build system on a project with dependency resolution being managed by ivy. I have it up and running with the file system being used for the local and shared repository currently. My ultimate goal would be that when developers are fixing bugs or creating new functionality, they would only be able to put artifacts into their local repository. When they belive their code is ready to be used by the rest of the team, it would be promoted to the proper branch in SVN and the group in charge of doing official builds would compile and publish the new artifacts.
So I guess my questions are how can you control who can publish to a repository? Does ivy just rely on filesystem permissions?
Also, I would eventually like to make my shared repository available via http. I think I could point apache to the file system repository directories for retrieving artifacts, but how do you setup publishing to an http repository?
I would suggest that you setup a repository manager to manage your project's build artifacts.
The best choices are one of the following:
nexus
artifactory
archiva
Publishing to a Maven repository means that your artifacts can be consumed by projects using other build technologies. All modern build systems support Maven (Including ivy, see the ibiblio resolver).
You could specify three resolvers in your ivy settings file. First would be a chain resolver which include remote and local ivy repositories. Second would be a local resolver for local ivy repository. Third a resolver to remote ivy repository only.
Every developer retrieves artifacts using first chain resolver.
Usual developer publish artifacts using second local resolver.
Your special team could use third remote resolver to publish in remoter ivy repository.
To protect remote repository from usual developers place it on (S)FTP server with write protection by password.
The only problem in this case is how to set versions on artifacts so that artifacts published in remote repository in some cases override locally published in some not.
Our team used such scheme few years ago. But now we use only local ivy repositories and CI server to build and run tests from various branches. We came up to this after switching to git.
for existing ivy repo easy to setup this: rest-ivy

Hosting my jars in Github with dependencies for Maven Repository

I am planning to host some of my API jars in Git hub as Maven Repository.
I have some 3rd party dependent jars needed with my jars.
When user like to pull my API i like the 3rd party dependent jars also downloaded to the local repository. say the 3rd party jars are 5 and they are in different repository.
when user adds a dependency as my api with my githum repository url can maven automatically find api dependent jars and it fetch from different places into local repository ?
How can i do this ? do we have any way to do with this ?
This article describes the way to perform what you need: http://cemerick.com/2010/08/24/hosting-maven-repos-on-github/
This plugin can help you to automate such task: http://synergian.github.com/wagon-git/index.html
Yes. Maven would be able to download all the dependent jars (based on dependencies mentioned in POM xml in your API).

Maven Project - github

Is it possible to publish your site reports to github? For instance, I run Checkstyle, Findbugs, Cross Reference, and other plugins and would like to have that publicly available. Since my project is already there, I'd like to just keep it there.
With the state of the plugins that exist now, you'd have to do some shimming. The site command (per your comments: wanting to use mvn:site) has a mechanism (stage) for pushing the resulting site somewhere, but it's all mostly predicated on SCP'ing it around to some final destination. For github, I don't think there's any obvious place to land things like that.
The solution would be to write something that extended the site plugin to check in the results to Github using the github pages functionality. Details on the github pages bits are available at http://pages.github.com/. To get there, you'll be writing something that checks in your resulting site to a root branch "gh-pages" and going from there.
There are maven github plugins wich works fine for me.
feature:
deploy artifacts
download artifacts
deploy site to gh-pages
See: https://github.com/github/maven-plugins and fork the example project at https://github.com/kevinsawicki/github-maven-example to try out.
The Maven way to publish your reports would be to build the Maven site and to deploy it using FTP, SCP or DAV.
I don't know if GitHub provides hosting space and supports any of this protocol. If it does, then the following resources will help:
Deploying a Site in the site plugin Usage page
10.6. Deploying Your Project Website
Maven 2: Getting "mvn site:deploy" to work
Releasing Maven projects to Github
Site Distribution in the POM Reference
If it doesn't, better look for another place to host your site.
I'm using this plugin for that: http://synergian.github.com/wagon-git/

Automating upload of artifacts in Nexus using Maven

Am trying to automate the process of uploading an artifact generated by Maven into a Nexus hosted repository (like a maven goal, which will upload the generated jar into a specified repository in Nexus). Is this possible? In the Nexus docs they have talked only about manual uploading.
I also looked at the nexus maven plugins and nothing like this is specified.
Thanks in advance
You have to use mvn deploy to deploy your artifacts via WebDAV (declare the Nexus DAV URL in the distributionManagement section).
See also
Getting started with Nexus Maven Repo Manager
13.3. Configuring Maven for Site Deployment (this link if for site deployment but it's similar)