问题
I am trying to create a graphql client in Java project and I am using apollographql library. The problem is that I am not able to get the dependencies using the pom.xml with version different than from Central repository. The other thing is that all of the examples are built with Gradle. Do you have any examples or ideas about how to create a simple subscription client using apollo library and maven project? One of the specific issues that I have is that once apollographql-runtime library is downloaded there is no "subscription" package. I wanted to use this dependency:
<dependency>
<groupId>com.apollographql.apollo</groupId>
<artifactId>apollo-runtime</artifactId>
<version>1.0.0-alpha5</version>
</dependency>
but I am not able to download it using pom.xml. In a different project, it was working with gradle.build file.
tried download .jar file but still no "subscription" package available.
pom.xml
<dependency>
<groupId>com.apollographql.apollo</groupId>
<artifactId>apollo-runtime</artifactId>
<version>1.0.0-alpha5</version>
<type>pom</type>
</dependency>
I want to import this class:
import com.apollographql.apollo.subscription.WebSocketSubscriptionTransport;
Could not resolve dependencies for project com.brzozaxd.rbpvendor2:rbpvendor2:jar:1.0-SNAPSHOT: The following artifacts could not be resolved: com.apollographql.apollo:apollo-api:jar:1.0.0-alpha5
回答1:
Works for me, and has the mentioned package and class inside it.
<project>
....
<repositories>
<repository>
<id>repo2</id>
<name>appolographql repo</name>
<url>https://dl.bintray.com/apollographql/android</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.apollographql.apollo</groupId>
<artifactId>apollo-runtime</artifactId>
<version>1.0.0-alpha5</version>
</dependency>
</dependencies>
</project>
来源:https://stackoverflow.com/questions/56266153/how-can-i-implement-apollographql-client-into-the-maven-project-to-activate-subs