Maven is unable to load dependencies from Central repository - maven

I am trying to create Spring Boot application with Netbeans Wizard. However, I get an error right after creation.
Downloading: http://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.2.4.RELEASE/spring-boot-starter-parent-2.2.4.RELEASE.pom
The build could not read 1 project -> [Help 1]
The project com.example:demo:0.0.1-SNAPSHOT (C:\Users\me\application\pom.xml) has 1 error
Non-resolvable parent POM: Could not transfer artifact
org.springframework.boot:spring-boot-starter-parent:pom:2.2.4.RELEASE from/to central
(http://repo.maven.apache.org/maven2): Failed to transfer file:
http://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-
parent/2.2.4.RELEASE/spring-boot-starter-parent-2.2.4.RELEASE.pom. Return code is:
501 , ReasonPhrase:HTTPS Required. and 'parent.relativePath' points at wrong local POM # line 5, column 10 -> [Help 2]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the
following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
So, Maven is not getting to the central repository, but can anyone tell me why this is?

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?

Could not find artifact io.confluent:kafka-rest-parent:pom:5.4.0-SNAPSHOT and 'parent.relativePath' points at no local

I am using maven 3 to run the application but I am getting the following error:
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for io.confluent:kafka-rest:[unknown-version]: Could not find artifact io.confluent:kafka-rest-parent:pom:5.4.0-SNAPSHOT and 'parent.relativePath' points at no local POM # line 7, column 12
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project io.confluent:kafka-rest:[unknown-version] (D:\Self\kafka-rest\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for io.confluent:kafka-rest:[unknown-version]: Could not find artifact io.confluent:kafka-rest-parent:pom:5.4.0-SNAPSHOT and 'parent.relativePath' points at no local POM # line 7, column 12 -> [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
here share pom .xml parent element
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.confluent</groupId>
<artifactId>kafka-rest-parent</artifactId>
<version>5.4.0-SNAPSHOT</version>
</parent>
<artifactId>kafka-rest</artifactId>
<packaging>jar</packaging>
<name>kafka-rest</name>
<description>
The Kafka REST Proxy provides a RESTful interface to a Kafka cluster, making it easy to
produce and consume messages, view the state of the cluster, and perform administrative
actions without using the native Kafka protocol or clients.
</description>
In order to build any Confluent project from the master branch, you must build its parent dependencies. You will not find SNAPSHOTS in a downloadable location
This means checking out Kafka source code, use Gradle to install its current snapshot, then Confluent common library, then Confluent Rest utils, and then the Schema Registry (for the Avro converter), and then finally build REST Proxy.
https://github.com/confluentinc/kafka-rest/wiki/FAQ
If you just want to run the REST Proxy, then download the latest Confluent Platform and configure the rest proxy config file to point at any existing Kafka brokers
An alternative solution is to build a released version.
You can find the releases by running
git tag --list
choose a tag t (e.g. v5.2.2) and then run
git checkout <t>
Then run
man clean package

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.

Maven: Can't find artifact on downloaded projects pom

After downloading a pom from a project (which I know builds fine on the remote build tools), I get this error when trying to test it locally:
$ mvn clean install -DskipTests
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/com/x/nms/integration/15.2.0.19/integration-15.2.0.19.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.x.oss.itpf.diagmon.taf:your-testware:2.20.7-SNAPSHOT: Could not find artifact com.x.nms:integration:pom:15.2.0.19 in central (httpepo.maven.apache.org/maven2) and 'parent.relativePath' points at wrong local POM # line 5, column 13
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.x.oss.itpf.diagmon.taf:ddc-testware:2.20.7-SNAPSHOT (C:\Users\erayfra\Workspace\ddc-testware\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for com.x.oss.itpf.diagmon.taf:your-testware:2.20.7-SNAPSHOT: Could not find artifact com.x.nms:integration:pom:15.2.0.19 in central (://repo.maven.apache.org/maven2) and 'parent.relativePath' points at wrong local POM # line 5, 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
Looks like, the problem is -
Could not find artifact com.x.nms:integration:pom:15.2.0.19
in central (://repo.maven.apache.org/maven2)
So, there are 2 things -
The artifact you are trying to include in your project is not available at the path of repository you specified.(Its the same what error message is saying)
You can change the repository path where maven is trying to find for this artifact : from repo.maven..., to the correct one. You could do this by
modifying the path either in your local pom,
or by changing it globally by editing the settings.xml file localed at .m2/settings.xml. .m2 is a hidden folder under /Users/{yourName}
( same location for both windows and mac)

Deployment from Weblogic using Maven (Netbeans)

Anyone know how it can make a starting deploy the weblogic using Maven application settings? Maven weblogic already managed to insert the plugins and dependencies but contrary to the way I have had problems. Any tips?
Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project jsf-scrumtoys:
Failed to deploy artifacts: Could not transfer artifact com.sun.faces:jsf-scrumtoys:war:0.1 from/to nexus-site (http://central_nexus/server): Failed to transfer file: http://central_nexus/server/com/sun/faces/jsf-scrumtoys/0.1/jsf-scrumtoys-0.1.war.
Return code is: 503, ReasonPhrase:Service Unavailable. -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Resources