尝试执行Flink作业时,出现此错误消息:
org.apache.flink.client.program.ProgramInvocationException: Neither a 'Main-Class', nor a 'program-class' entry was found in the jar file.
虽然在我的pom中,我将主类声明为:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<configuration>
<archive>
<manifestEntries>
<Main-Class>com.package.Main</Main-Class>
</manifestEntries>
</archive>
</configuration>
</plugin>
有人能告诉我我错过了什么吗?
谢谢
答案 0 :(得分:1)
这似乎是mvn package
上的错误。您是否尝试过以下命令?
./bin/flink run -c your.main.class flinkprogram.jar
答案 1 :(得分:0)
尝试使用pom.xml
中的下一个条目声明主类:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<configuration>
<archive>
<manifest>
<mainClass>com.package.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
答案 2 :(得分:0)