如何将apollographographll客户端实现到Maven项目中以激活订阅? [英] How can I implement apollographql client into the maven project to activate subscription?

查看:217
本文介绍了如何将apollographographll客户端实现到Maven项目中以激活订阅?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Java项目中创建graphql客户端,并且正在使用apollographql库.问题是我无法使用pom.xml的版本不同于中央存储库的版本来获取依赖项.另一件事是,所有示例都是使用Gradle构建的. 您是否有关于如何使用apollo库和maven项目创建简单订阅客户端的示例或想法?我遇到的具体问题之一是,一旦下载了apollographql-runtime库,就没有订阅"包. 我想使用这种依赖关系:

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>

但是我无法使用pom.xml下载它. 在另一个项目中,它正在使用gradle.build文件.

but I am not able to download it using pom.xml. In a different project, it was working with gradle.build file.

尝试下载.jar文件,但仍然没有可用的订阅"包.

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>

我要导入此类:

import com.apollographql.apollo.subscription.WebSocketSubscriptionTransport;

无法解析项目com.brzozaxd.rbpvendor2:rbpvendor2:jar:1.0-SNAPSHOT的依赖项:无法解析以下工件:com.apollographql.apollo:apollo-api:jar:1.0.0-alpha5

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

推荐答案

为我工作,并且里面有提到的包和类.

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>

这篇关于如何将apollographographll客户端实现到Maven项目中以激活订阅?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆