gpt4 book ai didi

java - Maven 和 graphql-java

转载 作者:行者123 更新时间:2023-11-30 07:52:51 25 4
gpt4 key购买 nike

我正在尝试运行来自 http://graphql-java.readthedocs.io/en/stable/getting_started.html#hello-world 的 HelloWorld 示例

我有编译问题:

Information:java: Errors occurred while compiling module 'graphqlApp'
Information:javac 1.8.0_131 was used to compile java sources
Information:25.07.17 22:41 - Compilation completed with 17 errors and 3 warnings in 1s 873ms
Warning:java: source value 1.5 is obsolete and will be removed in a future release
Warning:java: target value 1.5 is obsolete and will be removed in a future release
Warning:java: To suppress warnings about obsolete options, use -Xlint:-options.
/home/marcin/graphqlApp/src/main/java/HelloWorld.java
Error:(1, 15) java: package graphql does not exist
Error:(2, 22) java: package graphql.schema does not exist
Error:(3, 22) java: package graphql.schema does not exist
Error:(7, 22) java: package graphql does not exist
Error:(7, 1) java: static import only from classes and interfaces
Error:(8, 29) java: package graphql.schema does not exist
Error:(8, 1) java: static import only from classes and interfaces
Error:(9, 29) java: package graphql.schema does not exist
Error:(9, 1) java: static import only from classes and interfaces
Error:(14, 9) java: cannot find symbol
symbol: class GraphQLObjectType
location: class HelloWorld
Error:(17, 31) java: cannot find symbol
symbol: variable GraphQLString
location: class HelloWorld
Error:(16, 24) java: cannot find symbol
symbol: method newFieldDefinition()
location: class HelloWorld
Error:(14, 39) java: cannot find symbol
symbol: method newObject()
location: class HelloWorld
Error:(22, 9) java: cannot find symbol
symbol: class GraphQLSchema
location: class HelloWorld
Error:(22, 32) java: cannot find symbol
symbol: variable GraphQLSchema
location: class HelloWorld
Error:(26, 9) java: cannot find symbol
symbol: class GraphQL
location: class HelloWorld
Error:(26, 27) java: cannot find symbol
symbol: variable GraphQL
location: class HelloWorld

我的 Maven 文件:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>graphqlApplication</groupId>
<artifactId>graphqlApplication</artifactId>
<version>1.0-SNAPSHOT</version>

<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-andimarek-graphql-java</id>
<name>bintray</name>
<url>http://dl.bintray.com/andimarek/graphql-java</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java</artifactId>
<version>3.0.0</version>
</dependency>
</dependencies>
</project>

我的 Maven 配置有什么问题?

最佳答案

要使用 bintray 存储库中的最新版本,请更改依赖版本。您可以找到版本 here .

<dependencies>
<dependency>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java</artifactId>
<version>2019-04-09T05-29-53-bd9240c</version>
</dependency>
</dependencies>

如果你想使用最新的稳定版本(11.0.0)删除不必要的存储库声明并以这种方式使用它。

<!-- https://mvnrepository.com/artifact/com.graphql-java/graphql-java -->
<dependency>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java</artifactId>
<version>11.0.0</version>
</dependency>

关于java - Maven 和 graphql-java,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45312904/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com