JFrog Artifactory doesn't generate dependency declaration - gradle

I created default repository for gradle and published jar into it. I don't see snippets with dependency declaration on the JAR description page.
I have only added a local repository. What am I missing?

It seems that your file is not deployed according to the Maven/Gradle layout.
You do not have a groupID (Org) in the path.
In your case the correct file path should be:
perf-local-gradle/YOUR/ORG/cucumber-performance-testing-framework/1.0/cucumber-performance-testing-framework-1.0.jar
instead of:
perf-local-gradle/cucumber-performance-testing-framework/1.0/cucumber-performance-testing-framework-1.0.jar
You can read more about repo layouts here:
https://www.jfrog.com/confluence/display/RTF/Repository+Layouts

Related

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".

Maven dependency plugin downloads POM instead of tar.gz

I have two modules:
module 1: builds as .tar.gz with assembly plugin (type declared as 'pom' in its pom.xml)
module 2: needs to depend on the .tar.gz from the module above but always pulls the pom from the nexus instead.
Is there any trick? I see my .tar.gz on my Nexus correctly, it's just module 2 never goes for it, always just downloading the POM.
I finally found the issue. If I look in the metadata of the nexus (maven-metadata.xml)
I see my .tar.gz with a classifier tag from the maven assembly plugin id (the one from the external assembly xml).
I had this in the dependency plugin config, but not lower in the actual dependency section of my pom. Once I also added the classifier tag here, it all works as expected.

Which folder does the Maven settings.xml file belong in?

Okay so I have been searching for the answer here in SE and came across this comment and several others like it
When Maven tries to build a project, it will look in your local repository (by default ~/.m2/repository but you can configure it by changing the value in your ~/.m2/settings.xml) to find any dependency, plugin or report defined in your pom.xml. If the adequate artifact is not found in your local repository, it will look in all external repositories configured, starting with the default one, http://repo1.maven.org.`
So my question is where is the settings.xml file suppose to reside?
I was told by the previous developers on the project that it is in the maven\conf\settings.xml which is where the only settings.xml file we have is located. This is contradictory to the above comment of .m2/settings.xml.
Please clarify where this file is to reside and if it makes a difference where it is at.
Both answers are correct.
Basic config file for maven is inside mvn/conf/settings and you could add some configuration (or override basic config) with your personal maven settings file located in ~.m2/settings.xml
settings.xml file may be found in 2 places:
The Maven install: ${maven.home}/conf/settings.xml
A user’s install: ${user.home}/.m2/settings.xml
If both files exists, their contents gets merged, with the user-specific settings.xml being dominant.
Ref : https://maven.apache.org/settings.html

maven dependency repository with dots in folder's name

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

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