英文:
apache flink not able to resolve imports
问题
嗨,我正在学习 Flink 的介绍,但是我无法正确导入以下这些包:
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.walkthrough.common.sink.AlertSink;
import org.apache.flink.walkthrough.common.entity.Alert;
import org.apache.flink.walkthrough.common.entity.Transaction;
import org.apache.flink.walkthrough.common.source.TransactionSource;
上述的这些包无法导入。
我是从这个链接 [1] 上获取的信息。
在这个链接中,我通过 mvn 命令导入了项目。
请帮我解决这个问题。
[1]: https://ci.apache.org/projects/flink/flink-docs-release-1.11/try-flink/datastream_api.html
英文:
Hi iam working on the flink introduction but iam not able to import properly
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.walkthrough.common.sink.AlertSink;
import org.apache.flink.walkthrough.common.entity.Alert;
import org.apache.flink.walkthrough.common.entity.Transaction;
import org.apache.flink.walkthrough.common.source.TransactionSource;
these above packages are not able to import
i have used from the following site link
in this link i have imported the project via mvn command
please help me resolve this
答案1
得分: 2
在我的IDE(IntelliJ)中尝试后,我发现要想运行该应用程序,我必须在“Run / Edit Configurations”下选择“包括具有“Provided”范围的依赖项”选项。一旦我这样做了,一切都正常工作了。
我能够在命令行中构建该应用程序(通过“mvn clean package”)而不需要进行任何更改。
英文:
I just tried this myself, and found that in order to run the application in my IDE (IntelliJ) I had to select the option under Run / Edit Configurations to 'Include dependencies with "Provided" scope'. Once I did that, everything worked fine.
I was able to build the application from the command line (via "mvn clean package") without making any changes.
答案2
得分: 0
请您验证一下在您的 Maven pom.xml
文件中的以下构件:
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_2.12</artifactId>
<version>1.11.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-walkthrough-table-java</artifactId>
<version>1.11.1</version>
</dependency>
英文:
Can you please verify the below artifact in your maven pom.xml?
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_2.12</artifactId>
<version>1.11.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-walkthrough-table-java</artifactId>
<version>1.11.1</version>
</dependency>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论