Creating maven project from local Maven repo - maven

I am trying to create a maven project in a Windows virtual machine. But am unable to create as there is a proxy setting that doesn't allow me to connect to https://repo.maven.apache.org/maven2
But I do have another link that have the maven repos. But am not sure how to create the maven project using the link that I have. Can someone help me?
Thanks

You can specify another repository in your pom.xml file, but you’ll have to do it for every maven project you’ll build.
You can also specify that repository in your settings.xml file, which will be available to all maven projects.
See the informations here : https://maven.apache.org/guides/mini/guide-multiple-repositories.html

Related

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:1.1 from any of the configured repositories. while using in STS

I am able to create Spring Boot Starter Project and Maven Web Project from the STS, but somehow unable to create the maven-archetype-quickstart project in eclipse, its giving me below error
In my project, I am using cacert file and custom setting.xml
try
maven clean install -U
as your repository is cached so try to flush the cache using -U
I was able to solve this issue by simply deleting the .m2 folder and create maven project from scratch.
After facing the same issue and going through the message several times - I found that in the local repository i.e. .m2, under the location - org\apache\maven\archetypes\maven-archetype-quickstart\1.1 - we found the error in the file - 'm2e-lastUpdated.properties' as '#default-central-https://repo.maven.apache.org/maven2/.lastUpdated=1551236380266
https://repo.maven.apache.org/maven2/.error=Could not transfer artifact org.apache.maven.archetypes:maven-archetype-quickstart:jar:1.1 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org'
So my Eclipse was not able to download the required JARS may be cause it is behind the firewall and in that case - Place the 'maven-archetype-quickstart-1.1.jar' and 'maven-archetype-quickstart-1.1.pom' in your local repo at the location - 'org\apache\maven\archetypes\maven-archetype-quickstart\1.1' using the link - JARS_POM and then follow the same step to create the maven Project.
Better solution is to use proxy through 'setting.xml' file of Maven to bypass the firewall to download Maven plugins and jars.
You should also check if the maven archetype catalog to eclipse is configured properly.

Setting Local Repository in Maven

I want to add a local Repository to Maven, because i want to use my own archetype for building a maven pom.
One Solution i ve found was to add this to the setting.xml:
/.m2/repository
but it doesn't work.
Has anyone a good solution?

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.

How to deploy JAR to Maven remote repository

Is there any way to put my JAR file in remote repository, so my maven project can get this JAR file from any place via Internet?
I have downloaded and did some fixes in the ReportNG project: https://github.com/dwdyer/reportng .
Using ANT I have compiled this project into JAR, now I want to put it into remote Maven repository, but don't know how I can do that.
Could somebody please suggest me the way, how I can perform that?
If it is a released version you want to make available in maven central follow this guide: http://maven.apache.org/guides/mini/guide-central-repository-upload.html
I'm no github professional but since a maven repo is just a file structure with some meta-data you can put it anywhere maven can read it (ftp, http, ...). so you could create a git repo to host your maven artifacts. see http://cemerick.com/2010/08/24/hosting-maven-repos-on-github/ for an example. (it may be outdated - github may have something like maven repo hosting, I just dont know)
A lightweight way to create your own maven repository is to store it on github. See Hosting a Maven repository on github for more details
I followed sonatype open source project maven deployment guide https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide and successfully deployed the latest version of reportNG into maven central repository. Now maven have both 1.1.3 and 1.1.4
http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.uncommons%22%20AND%20a%3A%22reportng%22
You should do a pull request to the github project. If the maintainer likes your fix he will put it in the next version.
If you need your fix in a remote repo NOW then you'll have to setup your own maven repository.

How to create the repository (role is repository manager)with nexus

i created a maven repository using nexus and upload the jars files.Same way how to upload the maven plugins to repository.i directly add the maven-complier-plugin,it is not working.it will gives some exception like org.apahce,parenet ,plexus ,codehaus required and org.apache.maven.lifecycle errors are geting..
i will not be maven central repository,only using commpany repository includes every in my repository jars and maven plug
plz help me i am first create the repository.
Did you specify a mirror in your settings.xml file? If you want to force all users to use your repo and not repo1.maven.org, you'll need to enforce that. Also, you probably want your nexus to proxy central so that any artifact you don't host will still be available once you setup the mirror to block all outside repos.

Resources