无法将Flink导入项目

时间:2017-12-05 05:55:51

标签: scala build apache-flink flink-streaming

所以我用它来安装一个示例Flink项目。 https://github.com/tillrohrmann/flink-project.g8

我正在尝试使用这个模板,让我开始编写一个Flink摄取应用程序,而不必担心依赖,但它会适得其反。事实证明,当我尝试与sbt同步时,我无法找到Flink(不会说谎,但这部分对我来说甚至模糊)。想知道是否有人知道如何让我的项目找到Flink。很高兴使用这项技术。

Error while importing sbt project:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384M; support was removed in 8.0
[info] Loading project definition from /Users/Sam/IdeaProjects/cryptoingestion/project
[info] Set current project to cryptoingestion (in build file:/Users/Sam/IdeaProjects/cryptoingestion/)
>
[info] Defining */*:sbtStructureOptions, */*:sbtStructureOutputFile, root/*:shellPrompt
[info] The new values will be used by no settings or tasks.
[info] Reapplying settings...
[info] Set current project to cryptoingestion (in build file:/Users/Sam/IdeaProjects/cryptoingestion/)
[info] Applying State transformations org.jetbrains.sbt.CreateTasks from /Users/Sam/Library/Application Support/IdeaIC2017.3/Scala/launcher/sbt-structure-0.13.jar
[info] Reapplying settings...
[info] Set current project to cryptoingestion (in build file:/Users/Sam/IdeaProjects/cryptoingestion/)
[info] Updating {file:/Users/Sam/IdeaProjects/cryptoingestion/}root...
[info] Resolving org.scala-lang#scala-library;2.12.2 ...
[info] Resolving org.apache.flink#flink-scala_2.12;1.3.2 ...
[info] Resolving org.apache.flink#flink-scala_2.12;1.3.2 ...
[warn]  module not found: org.apache.flink#flink-scala_2.12;1.3.2
[warn] ==== local: tried
[warn]   /Users/Sam/.ivy2/local/org.apache.flink/flink-scala_2.12/1.3.2/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/apache/flink/flink-scala_2.12/1.3.2/flink-scala_2.12-1.3.2.pom
[warn] ==== local-preloaded-ivy: tried
[warn]   /Users/Sam/.sbt/preloaded/org.apache.flink/flink-scala_2.12/1.3.2/ivys/ivy.xml
[warn] ==== local-preloaded: tried
[warn]   file:////Users/Sam/.sbt/preloaded/org/apache/flink/flink-scala_2.12/1.3.2/flink-scala_2.12-1.3.2.pom
[warn] ==== Apache Development Snapshot Repository: tried
[warn]   https://repository.apache.org/content/repositories/snapshots/org/apache/flink/flink-scala_2.12/1.3.2/flink-scala_2.12-1.3.2.pom
[warn] ==== Maven2 Local: tried
[warn]   file:/Users/Sam/.m2/repository/org/apache/flink/flink-scala_2.12/1.3.2/flink-scala_2.12-1.3.2.pom
[info] Resolving org.apache.flink#flink-streaming-scala_2.12;1.3.2 ...
[info] Resolving org.apache.flink#flink-streaming-scala_2.12;1.3.2 ...
[warn]  module not found: org.apache.flink#flink-streaming-scala_2.12;1.3.2
[warn] ==== local: tried
[warn]   /Users/Sam/.ivy2/local/org.apache.flink/flink-streaming-scala_2.12/1.3.2/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/apache/flink/flink-streaming-scala_2.12/1.3.2/flink-streaming-scala_2.12-1.3.2.pom
[warn] ==== local-preloaded-ivy: tried
[warn]   /Users/Sam/.sbt/preloaded/org.apache.flink/flink-streaming-scala_2.12/1.3.2/ivys/ivy.xml
[warn] ==== local-preloaded: tried
[warn]   file:////Users/Sam/.sbt/preloaded/org/apache/flink/flink-streaming-scala_2.12/1.3.2/flink-streaming-scala_2.12-1.3.2.pom
[warn] ==== Apache Development Snapshot Repository: tried
[warn]   https://repository.apache.org/content/repositories/snapshots/org/apache/flink/flink-streaming-scala_2.12/1.3.2/flink-streaming-scala_2.12-1.3.2.pom
[warn] ==== Maven2 Local: tried
[warn]   file:/Users/Sam/.m2/repository/org/apache/flink/flink-streaming-scala_2.12/1.3.2/flink-streaming-scala_2.12-1.3.2.pom
[info] Resolving org.scala-lang#scala-compiler;2.12.2 ...
[info] Resolving org.scala-lang#scala-reflect;2.12.2 ...
[info] Resolving org.scala-lang.modules#scala-xml_2.12;1.0.6 ...
[info] Resolving jline#jline;2.14.3 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.apache.flink#flink-scala_2.12;1.3.2: not found
[warn]  :: org.apache.flink#flink-streaming-scala_2.12;1.3.2: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]  Note: Unresolved dependencies path:
[warn]      org.apache.flink:flink-scala_2.12:1.3.2 (/Users/Sam/IdeaProjects/cryptoingestion/build.sbt#L22)
[warn]        +- com.cryptocorp:cryptoingestion_2.12:0.1
[warn]      org.apache.flink:flink-streaming-scala_2.12:1.3.2 (/Users/Sam/IdeaProjects/cryptoingestion/build.sbt#L22)
[warn]        +- com.cryptocorp:cryptoingestion_2.12:0.1
[trace] Stack trace suppressed: run 'last mainRunner/*:ssExtractDependencies' for the full output.
[trace] Stack trace suppressed: run 'last root/*:ssExtractDependencies' for the full output.
[trace] Stack trace suppressed: run 'last root/*:update' for the full output.
[error] (mainRunner/*:ssExtractDependencies) sbt.ResolveException: unresolved dependency: org.apache.flink#flink-scala_2.12;1.3.2: not found
[error] unresolved dependency: org.apache.flink#flink-streaming-scala_2.12;1.3.2: not found
[error] (root/*:ssExtractDependencies) sbt.ResolveException: unresolved dependency: org.apache.flink#flink-scala_2.12;1.3.2: not found
[error] unresolved dependency: org.apache.flink#flink-streaming-scala_2.12;1.3.2: not found
[error] (root/*:update) sbt.ResolveException: unresolved dependency: org.apache.flink#flink-scala_2.12;1.3.2: not found
[error] unresolved dependency: org.apache.flink#flink-streaming-scala_2.12;1.3.2: not found
[error] Total time: 2 s, completed Dec 5, 2017 12:51:24 AM

编辑:我得到了要构建的项目,但我无法在IDE中单击。我的意思是当我尝试进入Flink类时,它无法找到声明。

1 个答案:

答案 0 :(得分:3)

Flink Scala currently only supports Scala 2.10 and 2.11,因此您必须将Scala降级为其中一个版本或使用其Java接口。