3

When I do a "mvn clean install" command in a project created using the S/4HANA Cloud SDK version 2.8.1 archetype, I get the following error:

[ERROR] Failed to execute goal com.sap.cloud.s4hana.plugins:s4sdk-maven-plugin:2.8.1:usage-analytics (default) on project zzzzz-application: Execution default of goal com.sap.cloud.s4hana.plugins:s4sdk-maven-plugin:2.8.1:usage-analytics failed: Plugin com.sap.cloud.s4hana.plugins:s4sdk-maven-plugin:2.8.1 or one of its dependencies could not be resolved: Failed to collect dependencies at com.sap.cloud.s4hana.plugins:s4sdk-maven-plugin:jar:2.8.1 -> com.sap.cloud.s4hana.plugins:usage-analytics:jar:[2.8.1,): No versions available for com.sap.cloud.s4hana.plugins:usage-analytics:jar:[2.8.1,) within specified range -> [Help 1]

All works fine with Version 2.8.0. Could you please double check?

  • The artifact should be available on Maven Central: https://search.maven.org/artifact/com.sap.cloud.s4hana.plugins/usage-analytics/2.8.1/jar Which archetype are you using? – Sander Wozniak Dec 12 '18 at 11:17
  • mvn archetype:generate -DarchetypeGroupId=com.sap.cloud.s4hana.archetypes -DarchetypeArtifactId=scp-neo-javaee7 -DarchetypeVersion=2.8.1 – Simmaco Ferriero Dec 12 '18 at 11:49

2 Answers2

0

I've just tried to generate a project with this command and it worked for me:

mvn archetype:generate -DarchetypeGroupId=com.sap.cloud.s4hana.archetypes -DarchetypeArtifactId=scp-neo-javaee7 -DarchetypeVersion=2.8.1

Can you try the following to rule out issues with your local Maven repository by using the following command for building your project:

mvn clean compile -Dmaven.repo.local=localrepo -s localsettings.xml

where the localsettings.xml file should look like this:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                        http://maven.apache.org/xsd/settings-1.0.0.xsd">
</settings>
Sander Wozniak
  • 650
  • 8
  • 27
  • 1
    Thanks Sander, using your suggestion I was able to compile it. This made me understand that there was something wrong with my repo. So I went into the ~/.m2 folder and deleted the repository folder. Then I re-ran the "mvn clean install" again and it worked fine. There was something corrupt there! – Simmaco Ferriero Dec 12 '18 at 14:21
0

Something went wrong with your sap maven repo. Delete the ~.m2\repository\com\sap folder and run "mvn clean install" again will solve your problem.

Leo Wang
  • 41
  • 6