-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cant get this artifact from jitpack #22
Comments
I have encountered the same issue and hope it can be resolved. Thank you. |
Any update on this? I am also experiencing this issue. |
@CodebyAmir You can use the following Maven dependency: <!-- https://mvnrepository.com/artifact/io.github.hamawhitegg/serpapi-client -->
<dependency>
<groupId>io.github.hamawhitegg</groupId>
<artifactId>serpapi-client</artifactId>
<version>0.1.7</version>
</dependency>
Note that it requires Java 17 or later(Because my entire project is using Java 17.). Here is an example code: SerpApiSearch search = new GoogleSearch();
Map<String, String> parameter = new HashMap<>();
parameter.put("engine", "google");
parameter.put("google_domain", "google.com");
parameter.put("gl", "us");
parameter.put("hl", "en");
parameter.put("q", "High temperature in SF yesterday");
search.setParameter(parameter);
JsonObject result = search.getJson();
String searchResult = result.getAsJsonArray("organic_results")
.get(0)
.getAsJsonObject()
.get("snippet")
.getAsString();
System.out.println(searchResult); The output is like: See weather overview. San Francisco Temperature Yesterday. Maximum temperature yesterday: 69 °F (at 2:56 pm) Minimum temperature yesterday: 54 °F (at 4:56 am)
|
@jvmvik, may #3 fix the artifacts downloading? Edit: @ai-for-java @CodebyAmir @HamaWhiteGG Follow the next steps to get artifacts from the jitpack:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.serpapi</groupId>
<artifactId>google-search-results-java</artifactId>
<version>2.0.3</version>
<classifier>sources</classifier>
</dependency>
mvn clean install dependency:copy-dependencies package && javac -classpath .:target/dependency/* -d . $(find . -type f -name '*.java')`
java -cp .:target/dependency/* Main Full example: |
Hello,
How do I get this library in maven?
Could you please help?
This is what I have in my pom.xml:
<dependency> <groupId>com.github.serpapi</groupId> <artifactId>google-search-results-java</artifactId> <version>2.0.3</version> </dependency>
and:
<repositories> <repository> <id>jitpack.io</id> <url>https://www.jitpack.io</url> </repository> </repositories>
But I am always getting this error:
[ERROR] Failed to execute goal on project xxx: Could not resolve dependencies for project xxx: The following artifacts could not be resolved: com.github.serpapi:google-search-results-java:jar:2.0.3 (absent): Could not find artifact com.github.serpapi:google-search-results-java:jar:2.0.3 in jitpack.io (https://www.jitpack.io)
Thank you!
The text was updated successfully, but these errors were encountered: