maven dependency repository with dots in folder's name - maven

There I described a problem: maven can't find dependencies [dependencyResolutionException]
But when I start to analyze the url from which maven try to download object I saw
http://artifacts.com/rep/com/project/rest/common/2.0.5/common-2.0.5.pom
that it uses com/project/rest path. But in the repository in artifacts.com it has folder with com.project.rest and not subfolder structure.
How to resolve it? How to make maven download from
http://artifacts.com/rep/com.projet.rest/common/2.0.5/common-2.0.5.pom

Related

Why doesn't the dependency contain a jar in the maven public repository https://mvnrepository.com?

I a maven rookie and am wondering how to get a binary jar file if it is not already in the repo. Specifically i'm in need of: jackson-dataformats-text-2.13.0.jar. Do I need to build it myself? I'm used to creating a project and marking a library as a dependency and seeing the jar downloaded into my .m2 cache but all i see in my cache is:
jchan#jchan-Z170N:~/.m2/repository/com/fasterxml/jackson/dataformat/jackson-dataformats-text/2.13.0$ ls
jackson-dataformats-text-2.13.0.jar.lastUpdated jackson-dataformats-text-2.13.0.pom.sha1
jackson-dataformats-text-2.13.0.pom _remote.repositories
Can someone advise how I am to get a built version of the jar from maven central?
We are still maintaining our ant build and I need the jar file for this. (i know i know, ancient stuff but team is not ready to port just yet).
parent pom don't contain jar file
This is the reason why no bundle link is present on the official public maven repository https://mvnrepository.com
The maven dependency is not a jar, is a parent. So the extension is: .pom which is just a plain pom.xml
Parent dependencies don't contain compiled class like .jar.
In your specific case, there are another dependencies who contains jars:
https://repo1.maven.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.13.0/
https://repo1.maven.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-xml/2.13.0/
advice
Check what classes do you need on your ant project and search if exist a jar (with the classes you need) on https://mvnrepository.com
Another option is to get all the dependencies from pom :
https://repo1.maven.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformats-text/2.9.0/jackson-dataformats-text-2.9.0.pom and download them into your ant project. In theory is the same of add the parent pom in a maven project

Maven Repository URL

I am new to maven and trying to understand how it works.
I am using maven to build my project. It download the jars that I have listed in pom.xml file. I do Maven Intall (eclipse), it downloads the jar file in my .m2/repository folder. Everything works well but I cannot figure out how it knows to pull the jar files from https://repo.maven.apache.org/maven2/. In which file, this url is defined. I do not have setting.xml file in .m2/repository and I do not have reference to https://repo.maven.apache.org/maven2/ in pom.xml. I searched everywhere in my project but no references to this URL. Just wondering which file has this URL.
thank you so much
The Maven Central Repository is defined in the Maven "Super POM".

IntelliJ downloads all the jars from my local maven repo to the system/jars folder

I am new to intelliJ and trying to import maven projects. IntelliJ downloads all the jars from my local maven repo to the system/jars folder. Which is getting huge.
How can i make sure it does not copies the jar from local maven repo to system/jars folder instead should resolve dependency from the local maven repo only
Today I'v found that my system/jars folder is 6.6GB, maven dependencies which were updated are kept in jars folder even when not used.
Is there a possibility to clean this folder from old dependencies?
Also it would be better to use dependencies from local maven repo rather than making duplicates.

What does it mean to say that a pom is installed in local repository?

From the book Maven: The Complete Reference inside the section 3.6.1. Grouping Dependencies it says :
If you create this project in a directory named persistence-deps, all
you need to do is create this pom.xml and run mvn install. Since the
packaging type is pom, this POM is installed in your local repository.
You can now add this project as a dependency and all of its
dependencies will be added as transitive dependencies to your project.
When you declare a dependency on this persistence-deps project, don’t
forget to specify the dependency type as pom.
What does it mean to say that a pom is installed in local repository?
Every time Maven needs to find a a dependency, it first looks in the local repository - commonly located in an .m2 directory in your user home. If it can't find the dependency there, it downloads the dependency into your local repository and uses it from there.
When it says a pom is installed in the local repository, it means the POM file was copied into the correct place in the local repository. Other projects you build locally can then resolve that dependency and use it.

find out from which maven repository the jar is coming from

There is a plugin that works properly in my co-worker's system but doesn't in mine. I suspect it because of a repository included in his settings.xml but not in mine. Is there a tool that I can use to figure out from which repo is this plugin being downloaded from?
Maven stores that info in a file called _maven.repositories in your local maven repository (typically ~/.m2/repositories) for each artifact. The file is located right beside the corresponding artifacts in the local maven repository.
This file will typically list the repository / plugin-repository that the artifact was downloaded from. This matches to the repository from your settings.xml file.
In Maven 3, the file seems being changed to _remote.repositories

Resources