apache flink not able to resolve imports

Viewed 969

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

2 Answers

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.

enter image description here

I was able to build the application from the command line (via "mvn clean package") without making any changes.

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>

Related