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

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.

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?

Maven is unable to load dependencies from Central repository

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?

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)

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

Maven clean install unable to get artifact from maven central

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.

Resources