Directly transferring a .pom file from local maven repo to remote repo - maven

I have a maven "pom-only" artifact in my local repository (which is not built by me or my company , It was an very old one ). I want to transfer this to remote repository (our companies snapshot repository) . How do i do that .
I have following in my local repo under the version folder
****-1.8-SNAPSHOT.pom
****-1.8-SNAPSHOT.pom.sha1
How can i push both to remote repo. One of our project is dependent on this parent/Pom only artefact ?

The Web UI of your remote repository manager should provide functionality to upload/deploy artifacts manually. For Artifactory and Nexus I know for sure that they provide such.

Related

Install spring-boot-starter-parent and upload to nexus

I would like to install the spring-boot-starter-parent jar and upload it to my private nexus 3 repo. Then I hope to configure my project pom file to retrieve the dependency from there. How can i download spring-boot-starter-parent jar?
My intention is to set up this nexus repo so that future projects will pull depencies from this nexus repo (where this environment is not connected to the internet)
No need to upload in your nexus. You can configure proxy-repository:
A repository that proxies everything you download from Maven Central. Next time you download the same dependency, it will be cached in your Nexus.
Look at this for details
Need to do following configuration:
– create a private (hosted) repository for our snapshots
– create a private (hosted) repository for our releases
– create a proxy repository pointing to Maven Central
– create a group repository to provide all of these repos under a single URL
Another procedure:
If you want to upload list of jar then write gradle task to upload nexus repository. here you get details.

How to deploy local maven repo to remote repo

I've a valid local maven repo which is generated by a closed-source tool. I'd like to deploy the full repo to a remote maven repo.
Any clues how to do this ?
If you can't scp or transfer up the repo another way, then I assume you'd have to write a script that would walk your local repo and put them all up using the deploy plugin.
https://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html
If you're moving the whole repo up, I'd suggest to put it to an isolated repo so that it doesn't mix with other upstream repos like central.

Replicate nexus repository in my local server

I work in an organisation and we use nexus repositories. I want a simple approach of how can I replicate few groups from nexus repository in to local server so that maven downloads the dependencies from local server and not from nexus.
If you use local server in the sense of base machine then you use clean install as a maven goal. The build code will be available under .m2/repository folder.
Install Nexus locally, create Proxy Repository for each of the repo or group that you want to have locally. In Proxy Repository you'd need to set up URLs to the remote repos.
Now point Maven to this local Nexus (e.g. with <mirrors> in settings.xml). First time Maven downloads a dependency it will go to Local Nexus which would grab the dependency from the remote one. This file is going to be cached in Local Nexus and further downloads won't hit the Remote Nexus.
PS: don't know why you would do this.

What is meant by local repository and remote repository in Maven?

I am reading up Maven - The complete reference and came across this
Maven assumes that the parent POM is available from the local repository, or available in the parent directory (../pom.xml) of the current project. If neither location is valid this default behavior may be overridden via the relativePath element.
What exactly is meant by local and remote repository for a Maven installation and a project?
A local repository is a local directory structure that caches artifacts downloaded from remote repositories, or those that are manually installed (eg from the command line option).
A remote repository is a web service (defined by a URL) that contains versioned artifacts. This might be as simple as an Apache server, or a full-blown Maven repository, such as Artifactory, that allows uploading, permissions based on a user directory, etc.
http://maven.apache.org/guides/introduction/introduction-to-repositories.html
By default, Maven will source dependencies from, and install dependencies to, your local .m2 repository. This is a precedence rule, and your .m2 acts like a cache where Maven can source dependencies before downloading them remotely. You can bypass this behaviour like so: mvn -U ... (see mvn --help).
Your local .m2 can be found under C:\Users\{user}\.m2 on Windows, or /home/{user}/.m2 on Linux. If you do a mvn install, your project will be locally installed under the said .m2 repository.
A remote repository is a Maven repository, just like your local .m2 repository, hosted for you to source dependencies from, e.g. Maven Central.
Local repository is a repo. Into your local system, when you compile or install project all required dependencies downloaded into your local repo.
When you're working with your project, then Maven first tries to get dependencies from local. If it's not available, then Maven will try to download the dependency from a central repository.
central repo. is a online repo, which is provided by maven itself.

maven artifacts for local repository

I want to create a local repository for maven. For that, I have to download all required artifacts. Is there any direct download link available for all artifacts to be downloaded once?
The local repository will be automatically be created during your first call of Maven in relationship with a project. The default location for the local repository is $HOME/.m2/repository.
You don't need to download dependencies etc. cause Maven will do that automatically.

Resources