Unofficial migrate Nexus 2 -> 3 possible for Maven artifacts? - maven

First, I know that the upcoming Nexus 3.1 will offer migration of v2 to v3.
I also just applied for the beta migration for v2 to v3 (google forms).
My timing sucks, since the next few days I am going to setup and integrate a new Nexus 3 server.
Is it possible to manually copy my old Maven artifacts (from Nexus v2 server) to this new Nexus v3 server and let Nexus v3 reindex everything?
If so, how?

It's not possible to manually copy, however Nexus Repository Manager 3.1 is now released and you can use it to Upgrade.
As well, the incredible, edible Manfred Moser created this: https://github.com/simpligility/maven-repository-tools/tree/master/maven-repository-provisioner which you can use to take something from a file system into a Maven Repository AKA Nexus Repository Manager. I haven't used it myself, but it's probably exactly what you are looking for.
For those still checking this out, you can also use this simple bash script to import artifacts into Nexus Repository 3: https://gist.github.com/DarthHater/a4f2738e3bd40d242db22633b59dfd63

Related

Mapping the artefacts of one nexus Repository instance to another instance

I'm new to the nexus world. I wanna move all the artefacts from one nexus repository to another nexus repository instance.(or you can say I wanna migrate the repos)
below is the nexus instances I've and their current version.
one Nexus Instance (Source Repository instance): Nexus Repository Manager OSS (2.14 version)
2nd Nexus Instance (Destination Repository Instance):Sonatype Nexus (2.11 version)
Is there any way to do this:-
I know one solution which is a manual solution, one can manually move the repository from source to destination storage.
https://community.talend.com/s/article/Manually-migrating-artifacts-from-one-Nexus-environment-to-another-S5taY?language=en_US
I went through this solution thread of nexus community as well but not able to find out. ):
https://community.sonatype.com/t/to-copy-single-repository-from-old-instance-to-new/1679
Is there any 2nd way to achieve this like can we use any Jenkins plugins, or some script that can help us to achieve above or any rest api's way?
It would be very helpful if someone answer this.
Thanks in advance.

Migrating from Artifactory to Sonatype Nexus 3

I'm trying to migrate my artifactory repository to nexus 3, but following sonatype's recommendation, it just shows me how to migrate nexus 2, and from what I've seen, the file system structure is different between versions of nexus.
Has anyone managed this migration yet?
I couldnt find anything in the nexus migration documentation 3.
Here is the link I used from the sonatype site on migration: http://www.sonatype.org/nexus/2015/02/23/migrating-from-artifactory-archiva-or-a-raw-maven-repository-to-sonatype-nexus
Until NXRM3 implements an import ability, the recommended strategy I've heard is to migrate Artifactory to NXRM2 then migrate your NXRM2 to NXRM3.
Depending on what components you use, you may also be able to script the components from Artifactory directly to NXRM3 using stuff like this: http://exchange.sonatype.com/details?extension=4969301365
However, this won't work for all components, like probably won't work for docker. That's not to say you couldn't write something that would work but the linked strategy wouldn't work.
For import, you can watch/vote here. I envision it'll be possible once that's done, however, won't be sure til it's done=)

Download artifact from Nexus OSS 3.0.0-03 using browser/wget

I have a local installation of Nexus OSS 3.0.0-03.
I am able to upload snapshot and release jars.
Now I want to download those jars via the browser or wget, but I can't seem to find the REST API call to do it (for example in a shell script executed by Jenkins).
Prior to version 3 it seems one could use something like:
http://MY_REPOSITORY/nexus/service/local/artifact/maven/content?r=repoId&g=groupName&a=art&v=LATEST
Any ideas on how to do this with version 3?
If it's latest you are looking for, you can see the answer here: Sonatype Nexus 3 - get latest snapshot
This as of yet does not exist in Nexus Repository 3 but is coming in the nearish future as we revamp the REST API.
However, if you want to download an artifact and know it's coordinates, you can do that via constructing a URL using the patterns here as a helpful tool: https://cwiki.apache.org/confluence/display/MAVEN/Remote+repository+layout#Remoterepositorylayout-Repositoryartifactlayout

How to migrate from Artifactory to Nexus 2.8.0-05

I installed nexus-2.8.0-05-bundle.tar.gz and now I am trying to migrate old (single) repo from Artifactory.
How can I achieve this (Debian7)?
I read about migration plugin but I cannot seem to find the right one... I unzipped nexus-migration-plugin-packaging-1.5-webapp.zip into the nexus installation folder but it doesn't seem to work..or at least I cannot find any related actions from the web admin console localhost:8081/nexus.
Cheers,
newbie
In order to migrate to Nexus you would use the export tool of Artifactory to get the repositories as plain files and folders structure.
Then you create a repo in Nexus and simply copy that storage into place.
Further details are available in the Nexus book migration chapter.
You can also ping us via a support ticket or via the mailings lists or hipchat channel.
PS: The migration plugin is deprecated and should not be used.

How to opensource a Maven plugin?

I have a Maven plugin that I want to share with outside world. Is there an official Maven repository I can deploy this plugin too ? What are the steps involved ?
Any links to documentation much appreciated
I've been reading http://www.sonatype.com/people/2008/11/adding-a-jar-to-a-maven-repository-with-sonatype-nexus/ but this just seems to describe deploying to internal Nexus repository, wheras I want to deploy to an external repo so any user can use it.
I would recommend:
Setting up an account in Github in order to have a place to host your source code.
Setting up an account in Cloudbee's BuildHive. This is a free Jenkins CI for Open Source projects. This will test your project on every push to Github.
Request rights to publish your project to Maven Central.
The bit with the request will take around up to a day normally and then you'll be able to publish your code directly to Maven Central.

Resources