Error: Failed to execute goal on project xxxx inside jenkins build - maven

when i run the build in jenkins i got below error when i am trying to run in local its building fine.
[ERROR] Failed to execute goal on project xxx: Could not resolve dependencies for project xxx:xxx-bin:pom:10-2.1.0-test: The following artifacts could not be resolved: xxx-alerts:alerts-loader:jar:xxx:3-95210ce313-2.1.0-test, xxx-alerts:alerts-loader:zip:resources:3-95210ce313-2.1.0-test: Failure to find xxx-alerts:alerts-loader:jar:deps:3-95210ce313-2.1.0-test in http://xxx:8080/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 forced -> [Help 1]
[ERROR]

Delete ~.m2\repository and this should work for you.
Also, make sure u run the mvn command with clean before install

Related

Maven Build Failure releated to com.sap.cloud.s4hana.plugins:s4sdk-maven-plugin

I am facing an issue during the Maven build. The issue on my
terminal is: [ERROR] Failed to execute goal
com.sap.cloud.s4hana.plugins:s4sdk-maven-plugin:2.12.0:usage-analytics
(default) on project demo-generator-application: Execution default
of goal
com.sap.cloud.s4hana.plugins:s4sdk-maven-plugin:2.12.0:usage-analytics
failed: Plugin
com.sap.cloud.s4hana.plugins:s4sdk-maven-plugin:2.12.0 or one of its
dependencies could not be resolved: Failed to collect dependencies
at com.sap.cloud.s4hana.plugins:s4sdk-maven-plugin:jar:2.12.0 ->
com.sap.cloud.s4hana.plugins:usage-analytics:jar:2.12.1-M1: Failed
to read artifact descriptor for
com.sap.cloud.s4hana.plugins:usage-analytics:jar:2.12.1-M1: Failure
to find com.sap.cloud.s4hana:sdk-modules-bom:pom:2.12.1-M1 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 1]
The maven project I used can be found here:
https://github.com/SAP/cloud-s4-sdk-examples/blob/master/VDMGenerator/application
The document can be found:
https://blogs.sap.com/2018/04/30/deep-dive-10-with-sap-s4hana-cloud-sdk-generating-java-vdm-for-s4hana-custom-odata-service/
Please try to run mvn clean install -U to force an update of dependencies.

Different maven build result from Jenkins than directly

I'm setting up Jenkins for an existing maven project. When a build runs, the Jenkins console shows the following error (filenames/URLs changed):
[ERROR] Failed to execute goal on project: Could not resolve dependencies for project: Failure to find (file jar) in http://example.com:8081/nexus/content/repositories/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of repo has elapsed or updates are forced -> [Help 1]
[ERROR]
When I cd /var/lib/jenkins/jobs/Project/workspace and run mvn package myself, the build completes successfully.
I've tried forcing/cleaning, I've tried deleting the Jenkins project and re-adding.
How can I force the build through Jenkins, or what could be causing the cache error?

Maven build issues - can anyone help me in knowing why I see this error when I do run as maven install

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project resteasy: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test failed: Plugin org.apache.maven.plugins:maven-surefire-plugin:2.10 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-surefire-plugin:jar:2.10 (): Failed to read artifact descriptor for org.apache.maven.shared:maven-common-artifact-filters:jar:1.3: Could not transfer artifact org.apache.maven.shared:maven-common-artifact-filters:pom:1.3 from/to central (http://repo.maven.apache.org/maven2): Remotely Closed [id: 0x3004ed34, /192.168.200.22:59080 :> repo.maven.apache.org/93.184.215.223:80] -> [Help 1]
You can try a couple of options:
Use the debugging options. This will produce a lot of output, and probably you'll be able to understand whats really going on.
mvn -X test
In case you're running some kind of proxy on the repository (Nexus, Artifactory, and so on), you can try to disable it in your settings.xml and try to bring the artifact directly from the central repository.
Its theoretically possible that something went wrong in your local repository (by default ~/.m2) In this case try to remove all the packages from ''org.apache.maven.shared:maven-common-artifact-filters:jar:1.3'' and rerun the build.
How this helps

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