Maven clean install unable to get artifact from maven central - maven

After cloning the remote repo on to Linux remote machine, I am getting the following errors when trying to run mvn clean install:
[ERROR] The build could not read 1 project -> [Help 1] [ERROR]
[ERROR] Non-resolvable parent POM: Could not transfer artifact xxxxx
from/to central (http://repo.maven.apache.org/maven2): Connection to http://repo.maven.apache.org refused and 'parent.relativePath' points at wrong local POM # line 4, column 10: Connection timed out -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]
[ERROR] [Help 2]
These errors occur only when running mvn commands on Linux, the project builds successfully after mvn clean install on Windows environment...
Any ideas as to why this is happening on Linux machine?
Thanks

Connection to http://repo.maven.apache.org refused
The above message seems be due to network failure. As you say it builds successfully on windows and not on Linux, I envisage there must be some different network setting in your linux profile. Had you ever added any proxy? Check maven proxy setting and try again.

Related

How to find the cause of a Maven build error?

I try to make a local Maven build.
% mvn help:effective-settings
[INFO] Scanning for projects...
Downloading: http://example.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-parent/2.1.2.RELEASE/spring-boot-starter-parent-2.1.2.RELEASE.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for example.components.discovery:example-app:01-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.1.2.RELEASE from/to nexus (http://example.com/nexus/content/groups/public): Access denied to: http://example.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-parent/2.1.2.RELEASE/spring-boot-starter-parent-2.1.2.RELEASE.pom , ReasonPhrase:Forbidden. and 'parent.relativePath' points at no local POM # line 12, column 10
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project example.components.discovery:example-app:01-SNAPSHOT (/Users/me/workspace/example-app/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for example.components.discovery:example-app:99.99.99-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.1.2.RELEASE from/to nexus (http://example.com/nexus/content/groups/public): Access denied to: http://example.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-parent/2.1.2.RELEASE/spring-boot-starter-parent-2.1.2.RELEASE.pom , ReasonPhrase:Forbidden. and 'parent.relativePath' points at no local POM # line 12, column 10 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
Some noticeable facts:
I get the same error on other projects with the same Spring dependency.
Co-workers don’t have this problem when they run a Maven build of the project.
Before introducing Nexus, the Maven build was run successfully, and so did for other Spring projects.
If there were some syntax errors in the settings.xml, the above error would show first and follow by complaints of syntax errors in the settings.xml.
My settings.xml seems to have the same structure as my co-worker’s who can run the Maven build successfully, the user credentials are different, of course.
The above facts eliminate all possible causes stated in the help 1 document. Among 6 possible causes stated in the help 2 document, the only possible cause is #4 given the above facts. We have a tool to generate the settins.xml file and use Maven encryption to encrypt the password for the file. I don't know how to verify whether the encrypted password is correct or not. Any other possible causes?

How to solve the dependencies of building ignite 2.8 source code?

I am trying to build ignite 2.8 in windows 10, my java version is 1.8, and maven 3.8.5.
I build source code with the command below:
mvn clean install -P all-java,all-scala,licenses -DskipTests -D maven.javadoc.skip=true.
It failed and showed that:
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project ignite-jta: Could not resolve dependencies for project org.apache.ignite:ignite-jta:jar:2.8.0: Failed to collect dependencies at org.ow2.jotm:jotm-core:jar:2.2.3 -> org.ow2.carol:carol:jar:3.0.8 -> org.jacorb:jacorb:jar:2.2.3-jonas-patch-20071018: Failed to read artifact descriptor for org.jacorb:jacorb:jar:2.2.3-jonas-patch-20071018: Could not transfer artifact org.jacorb:jacorb:pom:2.2.3-jonas-patch-20071018 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [apache.snapshots (http://repository.apache.org/snapshots, default, snapshots), ow2-snapshot (http://repository.ow2.org/nexus/content/repositories/snapshots, default, snapshots), ow2 (http://maven.ow2.org/maven2, default, releases)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :ignite-jta
I have checked that the jar file of org.jacorb:jacorb:pom:2.2.3-jonas-patch-20071018 is no longer maintained in maven central and i cannot find its backup anywhere. I am not sure how to deal with that.

Using the parameter "LATEST' while building the project does not work with "mvn clean install"

If we use the 'LATEST' parameter when generating the project, the command 'mvn clean install' errors out. Should this parameter be used or should the latest version be provided in the command?
mvn archetype:generate "-DarchetypeGroupId=com.sap.cloud.s4hana.archetypes" "-DarchetypeArtifactId=scp-cf-tomee" **"-DarchetypeVersion=LATEST**" "-DgroupId=com.sap.cloud.s4hana.examples" "-DartifactId=my-app" "-Dversion=1.0-SNAPSHOT"
Error is
Error:
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/springframework/spring-framework-bom/5.1.1.RELEASE/spring-framework-bom-5.1.1.RELEASE.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Non-resolvable import POM: Could not transfer artifact org.springframework:spring-framework-bom:pom:5.1.1.RELEASE from/to central (https://repo.maven.apache.org/maven2): proxy.myproxy.corp # com.sap.cloud.s4hana:sdk-bom:2.7.1-SNAPSHOT, C:\Users\xxxxxxx\.m2\repository\com\sap\cloud\s4hana\sdk-bom\2.7.1-SNAPSHOT\sdk-bom-2.7.1-SNAPSHOT.pom, line 994, column 25
#[ERROR] The build could not read 1 project -> [Help 1]
[ERROR][ERROR] The project com.sap.cloud.s4hana.examples:address-manager1:1.0-SNAPSHOT (C:\my-app\pom.xml) has 1 error
[ERROR] Non-resolvable import POM: Could not transfer artifact org.springframework:spring-framework-bom:pom:5.1.1.RELEASE from/to central (https://repo.maven.apache.org/maven2): proxy.wdf.sap.corp # com.sap.cloud.s4hana:sdk-bom:2.7.1-SNAPSHOT, C:\Users\xxxxxx\.m2\repository\com\sap\cloud\s4hana\sdk-bom\2.7.1-SNAPSHOT\sdk-bom-2.7.1-SNAPSHOT.pom, line 994, column 25: Unknown host proxy.myproxy.corp -> [Help 2]
[ERROR][ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR][ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
The version 2.7.1-SNAPSHOT in not a released version. It is not available externally (maven-central). So, you cannot download it from maven central. However, 2.6.1 is available. That is why it works.
Please try with RELEASE instead of LATEST or better use released versions directly.
Please also check that settings.xml does not point to an internal snapshot nexus server and delete the local repository in your .m2 directory.
Have you checked your network configuration?
I can see a proxy and unknown host error in the log.

getting maven error while running the Selenium tests form Jenkins

I have a Maven project and written some Selenium TestNG scrips in it.
Jenkins installed on the Linux server and while I'm trying to run the Selenium tests from Jenkins getting this Maven error,
[ERROR] Plugin org.apache.maven.plugins:maven-compiler-plugin:3.5 or one of its dependencies could not be resolved:
Failed to read artifact descriptor for
org.apache.maven.plugins:maven-compiler-plugin:jar:3.5:
Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:3.5 from/to central (https://repo.maven.apache.org/maven2):
Connect to repo.maven.apache.org:443 [repo.maven.apache.org/23.235.47.215] failed: Connection timed out -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Build step 'Invoke top-level Maven targets' marked build as failure
Your Jenkins server failed to download a dependency from the Maven repository.
This is mentioned in the error message:
Connect to repo.maven.apache.org:443 [repo.maven.apache.org/23.235.47.215] failed: Connection timed out
This may be a temporary connectivity problem with your server, so you could try again.
If this error keeps happening, then check with your network administrator that the Jenkins server has access to that hostname and port, as it may be blocked by a firewall.

DSpace 4.x: Error while package building with Maven

I'm trying to install DSpace 4.1 on Ubuntu 14.04, but I'm getting a constant error while attempting to build the installation package with Maven (using mvn package), which is:
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.dspace:dspace:4.1
(/home/dspace/dspace-4.1-release/dspace/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.dspace:dspace-parent:4.1:
Failure to find org.sonatype.oss:oss-parent:pom:7 in
http://oss.sonatype.org/content/repositories/releases/ was cached in
the local repository, resolution will not be reattempted until the
update interval of sonatype-releases has elapsed or updates are
forced and 'parent.relativePath' points at no local POM #
org.dspace:dspace-parent:4.1, /home/dspace/dspace-4.1-release/pom.xml,
line 20, column 13 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read
the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
I've tried defining a proxy for Maven, I've tried having no proxy for Maven. I tried with both DSpace 4.2 and 4.1. Running mvn clean gets the same error.
I checked the sonatype repository and seemingly the release mentioned by the pom.xml doesn't exist (I didn't make any change to the pom.xml file).
Software info:
OS: Ubuntu 14.04 (Trusty Tahr).
DSpace 4.1, binary release (I've tried with 4.2, binary release, too, but still getting the same error).
Apache Maven 3.0.5.
Try to run mvn package in root folder /home/dspace/dspace-4.1-release/ and not in /home/dspace/dspace-4.1-release/dspace

Resources