Hi Sebastien,

You need to add the dependency under a “dependencies” section, like so:

<dependencies>
        <dependency>…<dependency>
<dependencies>

Then it should be working.

I would also recommend using the Flink quickstart Maven templates [1], as they 
already have a well defined Maven project skeleton for Flink jobs.

Cheers,
Gordon

[1] 
https://ci.apache.org/projects/flink/flink-docs-release-1.4/quickstart/java_api_quickstart.html

On 19 April 2018 at 10:17:11 PM, Lehuede sebastien (lehued...@gmail.com) wrote:

Hi Guys,

I have created a project with Maven to try to send data from Kafka to Flink. 
But when i try to build the project i have the following error :

[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on 
project processing-app: Compilation failure: Compilation failure:
[ERROR] 
/env/mvn/test-0.0.1/processing-app/src/main/java/com/test/alpha/ReadFromKafka.java:[24,51]
 package org.apache.flink.streaming.connectors.kafka does not exist
[ERROR] 
/env/mvn/test-0.0.1/processing-app/src/main/java/com/test/alpha/ReadFromKafka.java:[52,63]
 cannot find symbol
[ERROR]   symbol:   class FlinkKafkaConsumer011

Here is my "pom.xml" configuration for Flink Kafka connector : 

                <flink.version>1.4.2</flink.version>
                <java.version>1.8</java.version>
                <scala.binary.version>2.11</scala.binary.version>
                <maven.compiler.source>${java.version}</maven.compiler.source>
                <maven.compiler.target>${java.version}</maven.compiler.target>

                <dependency>
                        <groupId>org.apache.flink</groupId>
                        
<artifactId>flink-connector-kafka-0.11_${scala.binary.version}</artifactId>
                        <version>${flink.version}</version>
                </dependency>

And here is the import line in my java file :

import org.apache.flink.streaming.connectors.kafka.FlinkKafkaProducer011;

Can anyone could help me with this issue ? 

Regards,
Sebastien

Reply via email to