Jenkins could not resolve dependencies - maven

I have a problem with jenkins version 1.500. i am trying to build a project with a dependency to another project of mine.
The error is:
[ERROR] Failed to execute goal on project projectname: Could not resolve dependencies for project projectname:jar:1.0.0: Failure to find reference-project:jar:1.0.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
If I build this project via console and Maven, the whole projects build succeed.
I checked the dependency jar file in the repository, it is there at the right place.
Does Maven have a own repository or did I miss something?
But under the Jenkins system settings, I chose "Default(~/.m2/repository)" and I did not check the checkbox "use own repository" at the project settings. Any ideas?
UPDATE
I created a extra job for the dependency in jenkins and called the Maven goal install and then everything works fine. Before this step I installed the dependency via Console and mvn install.
Why is there a difference? (i tried the given solution with delete and reinstall, but this did not help)

Simple solution delete the folder from the ~/.m2/repository which represents the artifact you've written about. ~/.m2/repository/${groupId}/... and rebuild. That happens sometimes if you have some problems during download of the artifact etc.

I too have similar problem and tried deleting the folder in ~/.m2/repository/
still its now downloading dependencies from remote repository location to local

Related

Could not find artifact org.wildfly.core:wildfly-coer-parent:pom:myVersion in jboss-public-repository-group

I am using Maven for my project. I have a parent project myProjectA and when I do mvn clean install it builds successfully. myProjectA has multiple children, one of which is "childA1". This childA1 calls a plugin childB1 from myProjectB.
The problem is that when I try to do mvn clean install on childA1 then it fails with error:
Plugin my-maven-plugin:0.1-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for my-maven-plugin:jar:0.1-SNAPSHOT: Failure to find org.wildfly.core:wildfly-core-parent:pom:myVersion in http://repository.jboss.org/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss-public-repository-group has elapsed or updates are forced
I understand from the error that the dependency org.wildfly.core in my-maven-plugin is not found. This dependency does not appear explicitly in the pom of childA1 or childB1. So to try to solve my problem I added the dependency to childB1 and did mvn clean install on childB1, the dependency was resolved and build was successful. While doing this I saw that the dependency was in fact downloaded from http://mynexus/nexus/content/groups/public and not the jboss repository that childA1 tries to get it from.
I looked at the "effective pom" tab (in Eclipse) of childA1 and childB1 and there I saw that the correct repository, mynexus, was listed and not the jboss repository.
Other things I tried is running with -U and I made sure to build myProjectA before building childA1. Unfortunately this did not solve my problem. Any suggestions how to fix it are welcome.

Maven Build : was cached in the local repository

I am trying to build the multi module maven project but getting the error as below.
Unresolveable build extension: Plugin com.day.jcr.vault:content-package-maven-plugin:0.0.24 or one of its dependencies could not be resolved: Failure to find com.day.jcr.vault:content-package-maven-plugin:jar:0.0.24 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 2]
Unknown packaging: content-package # com.prj.prj.aem:aem-parent.ui.apps:[unknown-version], C:\latest\prj\ui.apps\pom.xml, line 34, column 16
I have the jar file content-package-maven-plugin-0.0.24.jar at C:\Users\user.m2\repository\com\day\jcr\vault\content-package-maven-plugin\0.0.24 location
You can do this.
mvn clean package -DskipTests -U -e
Notice that -U means to reload the jars from maven, that ignore the cache jars in your local file system.
Do you have the Adobe profile in your settings?
https://docs.adobe.com/docs/en/aem/6-2/develop/dev-tools/vlt-mavenplugin.html
(section "Obtaining the Content Package Maven Plugin")
I had the same issue as you, and resolved it by setting the activeByDefault to true in .m2/settings.xml
I faced a similar issue while using IntelliJ IDEA. Problem was that Idea has set a different maven home as I need to.
When you have this problem also with Idea, check your Settings -> Maven -> Maven home directory setting, if it is set as you need to.

Building Mavenized jCuda with maven

Well I have installed Nvidia driver and cuda 7 successfully and already built and run many jcuda (not mavenized) projects in eclipse.
But I wanted to migrate to the mavenized version one.
So, I cloned this repository and tried to build it. I am on Ubuntu 14.04 x64 and I have set up nexus, too. But when I want to build it with
mvn clean package I got this:
Downloading: http://localhost:8081/nexus/content/groups/public/jcuda/jcublas/0.7.0a/jcublas-0.7.0a.pom
[WARNING] The POM for jcuda:jcublas:jar:0.7.0a is missing, no dependency information available
for all of the *.poms
and after these warnings, the build get finished unsuccessfully with:
Could not resolve dependencies for project org.mystic:mavenized-
jcuda:jar:0.1.2: The following artifacts could not be resolved: jcuda:jcublas:jar:0.7.0a, jcuda:jcuda:jar:0.7.0a ...
and it lists all of the jcuda *.jars and *.sos
Have I forgotten something?
UPDATE:
I used option -Dmaven.repo.local=repo with mvn clean package and every thing is ok.
Yes, I'm 80% sure, that this is because of your local Nexus
Failure to find jcuda:jcublas:jar:0.7.0a in http://localhost:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are force (taken from your log file)
Could you turn it off? It should resolve the issue.
P.S. Current situation with mavenized-jcuda project is, that it takes artifacts from local repo, since this artifacts are not presented in Maven Central or other hosted repositories.
It was nexus problem. And I figured it out in a better way than turn it off.
In the maven settings.xml (~/.m2/settings.xml) the mirrorOf pattern of * causes any repository request to be redirected to this mirror and to my single repository group. Another option is external:* which matches all repositories except those using localhost or file based repositories.
Putting external:* instead of * solved my problem.

Building Valkyrie RCP

I'm trying to build Valkyrie RCP from the 1.2 release. According to their instructions, it should be easy: "Just clone the repository, and then use a mvn install command."
However, when I try the command, I get the following error:
[ERROR] Failed to execute goal on project valkyrie-rcp-core: Could not
resolve dependencies for project dk.navicon:valkyrie-rcp-core:jar:1.2:
Failure to find com.l2fprod:l2fprod-common-all:jar:7.3 in
http://repo.maven.apache.org/maven2 was cached in the local
repository, resolution will not be reattempted until the update
interval of central has elapsed or updates are forced -> [Help 1]
I can see that l2fprod-common-all-7.3.jar is included in the dependencies folder but Maven seems to be unaware of that. How should I resolve this problem?
Actually, it's now possible to build it using Gradle, which doesn't have the dependency issues . Also, there's a dependencies folder with batch scripts to install the missing dependencies if you still wish to use Maven.
As of 2.0 Valkyrie RCP will use Gradle.
The problem is that the given version of that dependency does not exist in Maven Central only older versions.
They would probably suggest you do a mvn install first on the file in the dependencies folder, then.
Try go down in deps and do a
mvn install -DgroupId=com.l2fprod -DartifactId=l2fprod-common-all -Dversion=7.3 -Dpackaging=jar -Dfile=l2fprod-common-all-7.3.jar
That would get you past that point locally.
After that re-execute your project build with a -Uoption.
Long term is to find the artifact and include it in a repository that is searchable from your maven settings or project profile.

Update interval of Maven Central Repo

Having zero experience with Maven, I am running a mvn clean install on a project and this is the error I get:
[ERROR] Failed to execute goal on project dnasequencing.CompaNY.com: Could not resolve dependencies for project com.CompaNY.dnasequencing:dnasequencing.
CompaNY.com:war:1.0-SNAPSHOT: The following artifacts could not be resolved: dsr-kepler:dsr-kepler:jar:0.0.1-SNAPSHOT, dsr-parser:dsr-parser:jar:0.0.1-
SNAPSHOT: Failure to find dsr-kepler:dsr-kepler:jar:0.0.1-SNAPSHOT in http://repo1.maven.org/maven2/ was cached in the local repository, resolution
will not be reattempted until the update interval of Maven_Central_Repo has elapsed or updates are forced -> [Help 1]
Based on these error messages, what is an startingpoint I should take a look for finding what is going wrong?
You can force Maven to update snapshots with the -U flag.
As far as what is going wrong, you can always check out the actual Maven website with your browser and see if the dependency actually exists.
http://search.maven.org/
If the dependency is not hosted in Maven central, then it seems it is a local dependency that you have to install in your local cache (run mvn clean install from that project).

Resources