0

After importing the project from GitHub, getting the maven dependency error

Following the S4HANA Cloud SDK SAP Press book exercises. After importing the project into intellij IDE, it thorows maven dependency errors.  Here are the steps-
1. Download the project to do unit test. Link: https://github.com/SAP/cloud-s4-sdk-book/tree/course/2_5_testing
2. Imported the project into IntelliJIDE 
3. Renamed the folder to address-manager (from cloud-s4-sdk-book-course-2_5_testing)
4. After importing went to the folder address-manager --> unit-tests --> src ---> test --> java --> com.sap.cloud.s4hana.examples.addressmgr --> commands --> GetAllBusinessPartnersCommandTest

After this, as soon we now open the command, we get these dependency errors All the piece of code like google, sdk and so on comes red and is not able to identify.

Sander Wozniak
  • 650
  • 8
  • 27
Rohit
  • 21
  • 1
  • Please build the project on the command line with "mvn clean install" and provide the dependency tree with "mvn dependency:tree" – Sander Wozniak May 27 '19 at 13:25
  • Hi Sander, Thank you for your response. Actually, after downloading and importing the first command mvn clean install itself is not working, hence I am not able to check the 2nd command. Getting the following error. Any inputs? C:\s4c80\address-manager>mvn clean install – Rohit May 27 '19 at 14:33
  • C:\s4c80\address-manager>mvn clean install [INFO] Scanning for projects... Downloading from central: https://repo.maven.apache.org/maven2/com/sap/cloud/s4hana/sdk-bom/2.1.0/sdk-bom-2.1.0.pom [ERROR] [ERROR] Some problems were encountered while processing the POMs: [ERROR] Non-resolvable import POM: Could not transfer artifact com.sap.cloud.s4hana:sdk-bom:pom:2.1.0 from/to central (https://repo.maven.apache.org/maven2): proxy @ line 16 , column 25 [ERROR] The build could not read 1 project -> [Help 1] – Rohit May 27 '19 at 14:36
  • Hi Sander, here is the latest update. 1. I removed the contents of .m2 folder and 2. then rebuilt the project 'mvn clean install -U'. However, I still got the errors that libraries not found and the red underlines were appearing. How do we remove these dependency issues? – Rohit May 28 '19 at 03:40
  • Resolved, Had to invalidate and restart the cache option in IntelliJIDE – Rohit May 28 '19 at 11:36

1 Answers1

0

The mentioned artifacts are available here. So you either have a setup issue or a connection issue.

Please make sure that:

  • your POM file does not contain any syntax errors
  • you can connect to Maven Central (you may have to check your proxy settings)

I also recommend to consult the Maven documentation for further help: https://maven.apache.org/guides/

Finally, please also make sure to use the latest SDK version.

Sander Wozniak
  • 650
  • 8
  • 27