Strange Maven3 error - maven

all, I get this error when building with maven (mvn clean install).
Can't find the description of the problem. maybe anybody encountered it, what does it mean and how to fix it? How to force the updates?
Failure to find org.springframework:spring:jar:3.0.0.RELEASE in http://download.java.net/maven/2/ was cached in
the local repository, resolution will not be reattempted until the update interval of Java.Net has elapsed or updates are forced -> [Help 1]

Not sure if this works for Maven 3, here's what would work for Maven 2. This should work to clean the local repository:
mvn dependency:purge-local-repository
Otherwise, try cleaning the specific artifact from your local repository:
* Linux: ~/.m2
* Windows: C:\Documents and Settings\USER\.m2

Related

Cannot download & install old OpenDayLight versions

I need to download an old ODL version for testing (Helium release in this case), but when I tried to build ODL with maven, it failed to download opendaylight.odlparent:odlparent:pom:1.4.7-SNAPSHOT from nexus repository (it seems old versions <3.0.4 were purged) and stopped.
Where can I download Helium ODL and run successfully?
Step to reproduce error:
git clone -b stable/helium https://github.com/opendaylight/controller.git
cd controller/
mvn clean install
[ERROR] The project org.opendaylight.controller:opendaylight-karaf-resources:[unknown-version] (/[...]/controller/opendaylight/distribution/opendaylight-karaf-resources/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.opendaylight.controller:commons.opendaylight:1.4.7-SNAPSHOT: Failure to find org.opendaylight.odlparent:odlparent:pom:1.4.7-SNAPSHOT in http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ was cached in the local repository, resolution will not be reattempted until the update interval of opendaylight-snapshot has elapsed or updates are forced and 'parent.relativePath' points at no local POM # org.opendaylight.controller:commons.opendaylight:1.4.7-SNAPSHOT, /[...]/controller/opendaylight/commons/opendaylight/pom.xml, line 4, column 11 -> [Help 2]
EDIT: This answer said SNAPSHOT releases had short lives, so for older versions one need to build all dependencies himself, how can I do it?
You need to do "git clone -b stable/helium ..." and build every project that the controller project depends on. For Helium I believe it's only odlparent and yangtools.

OpenDaylight netconf build issue

I've tried to build the netconf module following the instructions in the "Getting Started" sections of the ODL wiki.
Possible answers I've found:
Use correct 'settings.xml'.
Try to use different maven commands like:
mvn -Pq clean install;
mvn install -DskipTests
Unfortunately, all these variants didn't work for me.
So, I installed all necessary features like maven, got correct 'settings.xml', pulled netconf project from git and tried to build it using mvn clean install.
After that I got a lot of errors:
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.opendaylight.netconf:netconf-auth:1.4.2-SNAPSHOT: Failure to find org.opendaylight.odlparent:odlparent-bundle:pom:3.1.0 in https://nexus.opendaylight.org/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of opendaylight-mirror has elapsed or updates are forced and 'parent.relativePath' points at no local POM # line 11, column 13
...
[ERROR] The project org.opendaylight.netconf:netconf-auth:1.4.2-SNAPSHOT (/home/ssavchen/netconf/netconf/netconf-auth/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.opendaylight.netconf:netconf-auth:1.4.2-SNAPSHOT: Failure to find org.opendaylight.odlparent:odlparent-bundle:pom:3.1.0 in https://nexus.opendaylight.org/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of opendaylight-mirror has elapsed or updates are forced and 'parent.relativePath' points at no local POM # line 11, column 13 -> [Help 2]
org.apache.maven.model.resolution.UnresolvableModelException: Failure to find org.opendaylight.odlparent:odlparent-bundle:pom:3.1.0 in https://nexus.opendaylight.org/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of opendaylight-mirror has elapsed or updates are forced
...
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to find org.opendaylight.odlparent:odlparent-bundle:pom:3.1.0 in https://nexus.opendaylight.org/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of opendaylight-mirror has elapsed or updates are forced
I've got that the issue is in 'odlparent-bundle', but I have no idea what to do with it. Does anyone have any ideas?
Your Maven repository still “remembers” that it failed to download the OpenDaylight artifacts which the build needs. To fix that, you can force updates with -U:
mvn -U clean install
You also need the full JDK rather than the JRE to build, so install that:
sudo apt install openjdk-8-jdk

Jenkins could not resolve dependencies

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

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

Archiva/Maven failed to execute goal

When I try to build using Archiva/Maven, the system return this message:
Failed to execute goal on project ... The following artifacts could not be resolved: net.sf.josql:josql:jar:1.5, net.sf.josql:gentlyweb-utils:jar:1.5: Failure to find net.sf.josql:josql:jar:1.5 in ... repository/internal was cached in the local repository, resolution will not be reattempted until the update interval of ... has elapsed or updates are forced -> [Help 1]
How can I fix this?
Remove from your local repository directory (or all file with version 1.5):
$M2_HOME/repository/net/fs/josql/josql
It only work when I change from Archiva to Maven (local). Need further investigation...

Resources