Nexus proxy repository - proxy

I'm new to Nexus. I have added a proxy repository for http://reflections.googlecode.com/svn/repo/. Its added successfully. I can browse the repository content in the 'Browse remote' tab. But when I point my maven to my local Nexus mirror & execute it fails while accessing dependency for reflections, its not able to locate it in my nexus repository.

If you added the repository as a proxy repository in Nexus do not forget to add the proxy to the Repository Group which you use as mirror for all Nexus requests (public/snapshot) - assumed you have this kind of configuration.
(Took this from a former answer from me.)

Do you try to access the proxy directly?
I think it is better to create a group repository and add the Google repository there.

Related

Can Sonatype Nexus use maven's local repository

I now have a PC working as a Sonatype Nexus server and a development environment. I know Nexus stores artifacts for proxy type repository in SonatypRoot\sonatype-work\nexus\storage, and Maven will use a local repository to store artifacts (default directory is C:\USERS\USER_NAME\.m2\repository).
So the question comes when I'm using Maven with Nexus running on the same machine, because i have two copies of every artifact which is big waste of storage.
In Nexus's configuration tab for proxy type repository, there is an option named Override Local Storage Location.
My question is can I set this to my Maven's local repository?
That's a bad idea. One common purpose of nexus to publish artifact internally within your organisation. Typically this is done using mvn deploy. On the other hand your maven local repository serves purpose as a cache to avoid downloading stuff that has been obtained before. If you mix them together you might be accidentally publishing artifacts to your organisation while you just want to test locally in your PC.

accessing Ondemand Bamboo instance's maven repository

I am having some doubts/queries about setting up Ondemand Bamboo instance. I am having cloud based Git repository. I want to checkout source code, build my project with Maven 3.x and access generated maven artifacts repository.
Q:do Ondemand Bamboo instance provide maven repository access ?
Cloubees is providing this facility: it provides a maven central proxy that's nexus based and a private repository. So, in case of Cloudbees, developer has to point to repository hosted at CloudBees location https://repository-myproject.forge.cloudbees.com/release
Q: Is the similar facility available with Ondemand Bamboo setup?
If yes, to access maven repository, do I need to keep my Bamboo's Image-instance always in 'START' mode?
IF No, how can I transfer artifacts to locally hosted Nexus server? Is it possible to FTP/ upload from Bamboo instance to different server?
Any help/hint will be appreciated. Thanks
On cloudbees, the default maven configuration is set so that those maven repositories are available by default, so you don't have anything to configure. I don't think bamboo embrace the maven build process such a way

Restricted access to an artifact in the Maven Repository

I have a central Maven repository which is shared by more than one Projects within the Company LAN. Now, I need to have an artifact which is licensed for a single Project, to be placed in the shared repository.
Is it possible set authorized access to that artifact, the credential can ideally be in the pom file of the desired project.
Any better solution is more than welcome.
Maven doesn't handle access rights in repositories, since it's just a client fetching data from a server. If you're using a repository manager, read its documentation. If you're just hosting files behind an Apache HTTPD server, then configure HTTPD.
Alternatively, you could move that file in a separate repository, and configure just one project's POM to use it. This doesn't fix the fact that the repository will continue to be public, so other projects/teams could get to it if they really want to.

Maven Repositories for Spring Roo

My intent is to proxy Roo Maven repository with my local Nexus installation, so that it will contain Roo 1.2.0.RELEASE packages.
On http://static.springsource.org/spring-roo/reference/html/resources.html it is written that Roo builds are published on http://spring-roo-repository.springsource.org/release.
Unfortunately that link returns error NoSuchKey.
Is there some other Maven repository to get Roo packages from ?
Based on this Nexus ticket I solved my problem by:
create Proxy on Nexus for http://spring-roo-repository.springsource.org/release
add this repository into default "Public Repositories" group
Nexus will proxy requested artifacts and it will crate index of this artifacts, but it is not able to index the whole http://spring-roo-repository.springsource.org/release repository, because its index is not published. The reason of this problem is that it is hosted on Amazon S3 storage.
Create (in Nexus) a proxy repository with the remote storage location = http://spring-roo-repository.springsource.org/release
Then, add it to the public repositories group.

Why do the Sonatype docs suggest redefining the central repository with a bogus URL in settings.xml when using mirrorOf?

According to the Maven documentation:
You can force Maven to use a single repository by having it mirror all repository requests. The repository must contain all of the desired artifacts, or be able to proxy the requests to other repositories. This setting is most useful when using an internal company repository with the Maven Repository Manager to proxy external requests.
To achieve this, set mirrorOf to *.
This StackOverflow question also suggests that setting mirrorOf is sufficient to block an external repository, so why does the Sonatype documentation suggest overloading central with an unreachable URL?
The bogus URL is really irrelevant - you can set it to the original one if you need to, or the URL of your repository manager - as long as the mirrorOf is applicable, it won't be used.
The reason these examples redefine central is to set policies on artifact requests to the default repositories. By default, Maven does not enable snapshot requests to central, and uses default update and checksum policies. Redeclaring central allows these to be overridden - in this case, to enable snapshot artifacts and plugins, and the mirror then redirects all of these to the repository manager. This avoids the need to declare the repositories in your POM (as long as all users have their settings correct).
I wrote that so I can tell you what I was thinking ;-)
The central repository definition needs to be updated to enable snapshot retrieval for at least one repo, otherwise Maven won't even ask the repository manager (pointed to by the mirrorOf) for any snapshots.
While not required, I like to change the definition of the url to be an invalid one also so if there is a misconfiguration somewhere else in the system, it becomes immediately obvious what is happening. Otherwise Maven may still reach out to Central and mask the problems. It's essentially a fail-fast setup.
There's more information on this topic in an old blog I wrote
maven needs project dependencies to be available locally for it to run. It does not care about how it is made available - whether manually installed (using mvn install:install-file), through a mirror or by from central repository. It will fail to run if it is unable to find dependencies.
The sonatype documentation that you are referring to is on using nexus to mirror/proxy repositories. The url specified should be a valid nexus url and cannot be unreachable.
The same is suggested in the SO question as well.

Resources