Artifactory maven 3 unable to find a snapshot file - maven

I am having problems getting artifactory to suppy a jar file to a maven 3 build process
I have deploy the jar file gwt-openlayers-server-1.0-SNAPSHOT.jar to libs-snapshot-local
I can find this jar file by using the general lookup in the Artifacts tab, it shows up as
<dependency>
<groupId>org.gwtopenmaps.openlayers</groupId>
<artifactId>gwt-openlayers-server</artifactId>
<version>1.0-20130320.151820-1</version>
</dependency>
So I known artifactory has it.
When I attempt to do a build using a pom with the following section in it
<dependency>
<groupId>org.gwtopenmaps.openlayers</groupId>
<artifactId>gwt-openlayers-server</artifactId>
<version>1.0-SNAPSHOT</version>
I get a build error with a diagnostic about being unable to find gwt-openlater-server, see listing.
I don't understand why I am having this problem, artifactory has the file!
I am using mvn -U compile
Any suggestions

Check if you have maven-metadata.xml corruption, or perhaps your snapshot info is empty. It shouldn't be.

Related

How to fix The POM for XXX:jar:1.0 is missing, no dependency information available

We tried to build our project(Spring Boot 2.0.3 with Maven 3.3.9 dependency management)Jenkins Tool(Linux environment).Its saying build failure showing the following message in console "The POM for org.actus:ACTUS-Core-1.0:jar:1.0 is missing, no dependency information available".ACTUS is our custom java library developed by us and its in the local repository also.
This is the first time we started using Jenkins Tool. There are some other modules which depends on this same ACTUS jar.Those are also failing.I have searched for solution on internet.Some people said,make changes to settings.xml file.But in our development machine ,we cant find any such type of settings.xml file(in .m2)
remaining all dependencies are normal spring boot dependencies only.This is the only one external or custom jar.Using mvn install, we kept in maven local repo.
<dependency>
<groupId>org.actus</groupId>
<artifactId>ACTUS-Core-1.0</artifactId>
<version>1.0</version>
</dependency>
I will try to explain as much I can to solve your problem. I hope you are looking for settings.xml to update your maven Nexus repository. If you don't know about nexus repository, it's kind of public repo where you will get all open source dependency.
In your case, from your organization, you should have a private nexus repository and upload ACTUS-Core jar to there.
Then update your settings.xml file to use your company nexus repository. (Please check comments, it will be available in M2_HOME location)
So while you execute mvn install automatically it will upload in your private repository.
Now, in your pom.xml mention the same nexus repository. (It's optional)
Then, in your Jenkins script, you have updated this nexus repo.
So, the key point is you should have your own repo to upload ACTUS-Core jar and need to access the same while you building in Jenkin tool.
OR ELSE
If you find all the above activities in pain / not possible then I can suggest a short cut solution.
Create a lib folder under your project name ( same hierarchy as src) then add your ACTUS-Core.jar and commit that file along with your source code.
Then, update your pom file like below. It will work.
<dependency>
<groupId>com.test</groupId>
<artifactId>test</artifactId>
<version>11.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/fileName.jar</systemPath>
</dependency>

How to add aem Uber jar dependency in maven build

I have used the maven archetype10 as shown below and created the project structure and everything was fine.
mvn archetype:generate -DarchetypeGroupId=com.adobe.granite.archetypes -DarchetypeArtifactId=aem-project-archetype -DarchetypeVersion=10 -DarchetypeRepository=https://repo.adobe.com/nexus/content/groups/public/
Now i wanted to add the aem uber-jar dependency and added the below dependency tags in the project pom.xml and in core module pom.xml respectively and also my repository tags are same as https://repo.adobe.com/
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<version>6.2.0</version>
<scope>provided</scope>
</dependency>
after adding the above dependency tag when i compile it is giving me the below error.
[ERROR] Failed to execute goal on project aemexample.core: Could not
resolve dependencies for project
com.krishh.example:aemexample.core:bundle:0.1: Could not transfer
artifact com.adobe.aem:uber-jar:jar:6.2.0 from/to
adobe-public-releases
(http://repo.adobe.com/nexus/content/groups/public): hostname in
certificate didn't match: <repo.adobe.com> != <devedge.day.com> OR
<devedge.day.com> -> [Help 1]
Is there anything am missing to add extra dependencies to compile and run this successfully.
You seem to be missing a classifier in your dependency. Try adding the one for AEM APIs, as suggested in the documentation. This should help Maven locate the necessary JAR in the repository:
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<version>6.2.0</version>
<classifier>apis</classifier>
<scope>provided</scope>
</dependency>
If that doesn't help, you should also look at the certificate warning. Check out the answers to this question for more information on the subject.
TL;DR - possible causes could be:
an old Maven version using an HTTP library that is not compliant with the certificate being used by the repository - try upgrading Maven
erroneous certificate used by the server
potential network configuration issues between you and the repository
an actual attempt at getting you to download a malicious file by a party pretending to be the Nexus

Nexus doesn't download the complete artifact content from the Central repository

In our project we use the artifact
<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<version>1.7.5</version>
</dependency>
Everything works fine: Nexus downloads the same content as in http://repo1.maven.org/maven2/nl/jqno/equalsverifier/equalsverifier/1.7.5/ to its proxy repository.
('Download' column in artifact details on Nexus shows 'pom, jar')
Now, we switch to the newest version 2.0.2 of the artifact:
<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<version>2.0.2</version>
</dependency>
Then, when we try to build the project then the attempt fails. Nexus cannot resolve the artifact! It seems like Nexus didn't download the complete content of the artifact version ('Download' column in artifact details on Nexus shows 'pom, pom'). On the other site, when I look at the artifact in the Central repository, the content is as usual: http://repo1.maven.org/maven2/nl/jqno/equalsverifier/equalsverifier/2.0.2/.
What causes the problem with the newest artifact version? Why can't Nexus download it correctly?
You may have overlooked that your dependency is of type pom. This will only download the pom, because that's what you are asking for. Remove the <type> and you should get the jar aswell.
<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<version>2.0.2</version>
<type>pom</type> <-------------- Remove this
</dependency>
Assuming crea1's answer didn't solve your problem:
Maybe something went wrong when Maven downloaded the artifact, causing Maven to "think" the artifact was downloaded anyway.
You can force Maven to try and download it again with mvn -U test.
If that doesn't work, try going into ~/.m2/repository (or wherever Maven stores its artifacts locally on your system), locating EqualsVerifier, removing the entire 2.0.2 folder, and calling Maven again.

Downloading jar from github repo fails while using maven compile

I am new to Maven. Using the instructions mentioned here: http://activeintelligence.org/blog/archive/hosting-maven-repository-for-third-party-jars-on-git-bitbucketgithub/, I created a github maven repo for third-party jar. I can see the jar (and the corresponding pom) here: https://github.com/sushilmittal/wiki-keyword-extraction/tree/master/repository/com/rapid_i/rapidminer/5.3.006
My pom.xml has these two entries corresponding to the above jar:
<dependency>
<groupId>com.rapid_i</groupId>
<artifactId>rapidminer</artifactId>
<version>5.3.006</version>
</dependency>
and
<repositories>
<repository>
<id>wiki-keyword-extraction</id>
<url>https://github.com/sushilmittal/wiki-keyword-extraction/tree/master/repository/</url>
</repository>
</repositories>
When I do mvn compile, I get the following warning:
Downloading: https://github.com/sushilmittal/wiki-keywordextraction/tree/master/repository/com/rapid_i/rapidminer/5.3.006/rapidminer-5.3.006.pom
[WARNING] Checksum validation failed, expected https://github.com/sushilmittal/wiki-keyword-extraction/tree/master/repository/com/rapid_i/rapidminer/5.3.006/rapidminer-5.
3.006.pom
which further leads to the following error:
[ERROR] Failed to execute goal on project DataIndex: Could not resolve dependencies for project DataIndex:DataIndex:jar:0.0.1-SNAPSHOT: Could not find artifact com.rapid_i:rapidminer:jar:5.3.006 in wiki-keyword-extraction (https://github.com/sushilmittal/wiki-keyword-extraction/master/repository/) -> [Help 1]
If I manually go to the location https://github.com/sushilmittal/wiki-keywordextraction/tree/master/repository/com/rapid_i/rapidminer/5.3.006/, I can see the files. So I fail to understand why maven is unable to download the jar/pom from that location.
Any ideas?
First off, please read this post
Second, using a source control system as a Maven Repository is a really bad plan. The recommended thing to do is use a Maven Repository Manager. There are at least three implementations available and there is even an on-line hosting service.
Thirdly, if you insist on following this misguided plan, you need to tell Maven the https path to the raw files in the GitHub repo, not the HTML rendering of the file content with line numbers etc

Maven - Unable to resolve dependencies

Im trying to compile a Maven project. The compile fails however due to a "Failure to find xx.xxx.jar" in the repository i have specified in my settings.xml. I have access to this repository and when i navigate to the Url of the repository maven is trying to use i can see a pom file with the name of the jar but no jar. When i open the pom it contains the correct groupid and artificatid and jar name however the jar is not in the same directory.
Maven gives another error saying that "resolution will not be reattempted until the update interval of my repo-server has elasped or updated are forced".
What is happening here?
When maven goes to the repo i specify in settings.xml and finds a pom for the jar does it then try and go out to some external site to resolve the dependency or should the jar exist in the same folder as the pom?
What module are you attempting to download?
I discovered something similar with the following Maven central module:
http://search.maven.org/#artifactdetails|net.sf.json-lib|json-lib|2.4|jar
The Maven POM packaging declaration was jar, but no jar in Maven called "json-lib-2.4.jar"
When I looked at the files actually stored, I discovered that the author is providing two versions of the jar, each compiled for different versions of the JVM:
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk13</classifier>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>

Resources