Amazon PA API 5.0 migration - Cannot find Maven SDK dependency (public repository)
Asked Answered
F

3

14

I need to do Amazon PA API Migration on March. I'm trying to find a Maven public repository where is published the 'PA API 5.0 sdk'.

This is the official documentation : link

It says :

  1. Download paapi5-java-sdk-and-samples archive and unzip it.
  2. Open the project in any editor of your preference.
  3. Add all jars present in dependencies folder to the build path.

It's not professional and not maintainable doing like this..

Also many of these jars are old versions (2016 like).

I've tried to contact AWS PA API support but I've got generic response (read documentation etc.)

Suggestions? Do you know Java unofficial libraries? Thanks

Franconian answered 22/2, 2020 at 8:57 Comment(1)
I was not able to find a public repository that provided this artifact, however, I do think there would be a more professional and durable way to automatically download and include the dependency using Maven. Would an answer that provided this alternate solution to your overall problem (just not the specific request) be okay?Leverick
G
3

Same here. There is only an old maven sdk available. I cannot even import correctly the jar on intellij idea. The IDE is able to find alle the classes needed by the examples, but on building it says: "error: package com.amazon.paapi5.v1 does not exist". I added the jar with this procedure

Glyndaglynias answered 22/2, 2020 at 23:47 Comment(2)
1. extract paapi5-java-sdk-example zip. 2. import from existing sources (Eclipse project) in IntelliJ IDEA. 3. add dependencies directory as Library (right-click and Add as Library...) 4. insert your own secret PA credentials in placeholders. 5. run a sample request.Cob
Add client.setDebugging(true); to see requests & responses (enable debug logging).Cob
K
2

I have the same problem and totally agree that it's not professional and not maintainable at all.

My current workaround is just to integrate manually the paapi5-java-sdk-1.0.0.jar and then figure out what other dependencies were missing, and which one I don't need (for example junit-4.12.jar does not make not much sense for me when I just want to use it in production).

You might already having some dependencies in place that you don't need to add. For example you might already have Jackson. So don't add this to your pom.

All other dependencies that you need, instead of using the jar files, just add the offical repo of them to your pom as usual with the same version as you find in the zip file. That way you have the least manual dependencies as currently possible and are sure all additional dependencies work fine with the Amazon SDK.

In my case I just had to add okhttp, okio, gson, gson-fire and threetenbp from the offical repo.

Ketti answered 18/3, 2020 at 7:39 Comment(1)
Thanks, this helped a lot. Note to folks new to manually adding jars, put the jar in the app/libs folder. Then add this line to your app build.gradle dependency block: implementation fileTree(include: ['*.jar'], dir: 'libs'). I agree, this is very unprofessional on Amazon's part. Their recruiters keep contacting me, and seeing this is a clear warning sign not to work for them.Fox
B
1

You can use mvn install to install downloaded jar into your local repository. See here https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

Bribery answered 4/3, 2020 at 19:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.