Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin execution not covered by lifecycle configuration: net.alchim31.maven:scala-maven-plugin:3.1.4:testCompileue #25

Open
SyCode7 opened this issue May 30, 2018 · 6 comments

Comments

@SyCode7
Copy link

SyCode7 commented May 30, 2018

Hi,

I have cloned this repo as instructed here in order to get familiar with Flink. However, there are the errors in the projects after building and importing into Eclipse IDE. In the Flink Training Exercises project i find errors in the pom Plugin execution not covered by lifecycle configuration: net.alchim31.maven:scala-maven-plugin:3.1.4:testCompile. There are also errors in the project flink-quickstart-java . Some dependencies are not being resolved e.g. ExecutionEnvironment cannot be resolved in the BatchJob class. I have tried to clean the .m2 folder and complied both projects several times but there is no joy yet !

@alpinegizmo
Copy link
Contributor

alpinegizmo commented May 31, 2018

The quickstart was recently changed, which had an effect here. I got this working by selecting the add-dependencies-for-IDEA maven profile.

@SyCode7
Copy link
Author

SyCode7 commented May 31, 2018

@alpinegizmo thanks for the heads up. The challenge is that I am using eclipse, I am not sure if there is such a feature on eclipse ....are you aware of any ?

@alpinegizmo
Copy link
Contributor

alpinegizmo commented May 31, 2018

Yes, I did this with Eclipse. I added this section to <build> <plugins> in my pom file:

	<plugin>
	   <groupId>org.codehaus.mojo</groupId>
	   <artifactId>exec-maven-plugin</artifactId>
	   <version>1.6.0</version>
	   <executions>
	     <execution>
	       <goals>
	        <goal>java</goal>
	       </goals>
	    </execution>
	   </executions>
	   <configuration>
	      <mainClass>org.apache.flink.flink_quickstart_java.BatchJob</mainClass>
	   </configuration>
	</plugin>

and then created a Maven Build run configuration with

Goals: org.codehaus.mojo:exec-maven-plugin:java
Profiles: add-dependencies-for-IDEA

@SyCode7
Copy link
Author

SyCode7 commented May 31, 2018

@alpinegizmo i have tried on eclipse, I have the following error :

[INFO] --- exec-maven-plugin:1.6.0:java (default-cli) @ flink-java-project --- [WARNING] java.lang.RuntimeException: No data sinks have been created yet. A program needs at least one sink that consumes data. Examples are writing the data set or printing it. at org.apache.flink.api.java.ExecutionEnvironment.createProgramPlan(ExecutionEnvironment.java:943) at org.apache.flink.api.java.ExecutionEnvironment.createProgramPlan(ExecutionEnvironment.java:921) at org.apache.flink.api.java.LocalEnvironment.execute(LocalEnvironment.java:85) at org.apache.flink.quickstart.BatchJob.main(BatchJob.java:64) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282) at java.lang.Thread.run(Thread.java:745) [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE

@alpinegizmo
Copy link
Contributor

Yes, the skeleton batch job isn't complete. You could modify it to be like this, and it will work:

public class BatchJob {
    public static void main(String[] args) throws Exception {
	final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

	env.fromElements(1, 2, 3).print();
    }
}

If instead you want to try streaming, do this:

public class StreamingJob {
    public static void main(String[] args) throws Exception {
	StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

	env.fromElements(1, 2, 3).print();
	env.execute();
    }
}

@SyCode7
Copy link
Author

SyCode7 commented Jun 1, 2018

@alpinegizmo many thanks. your solution works ! I realized that I have to ignore the errors shown in eclipse .....very strange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants