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
[FLINK-2311] Fixes 'flink-*' dependency scope in flink-contrib. #880
Conversation
This is an interesting case. In theory, dependencies should be provided, such that building a fat-jar does not take them into account. However, when running examples out of IntelliJ, it does not work if the dependency is in "provided", as the dependency is not added to the classpath in that case. In the examples, we hence add them as "compile" scope dependencies. The storm compatibility layer could follow a rule, though. @mjsax Can you comment? |
As I've already written in the JIRA, I don't understand the problem you are trying to solve. |
From my understanding, "provided" would mean that a project that uses stuff from flink-contrib would not need to include the code from flink-contrib into the own program jar because flink-contrib code is provided automatically at runtime (ie, is included in flink-dist). However, Flink follows the opposite approach. "The flink-contrib folder is assumed to be provided by the user" means, that flink-contrib stuff is not included in flink-dist, thus, if flink-contrib stuff is use, the program must be contained in a fat-jar that includes flink-contrib classes. |
@mjsax exactly. Let's at the moment I land in the following situtaion.
|
@StephanEwen can you tell me what package doesn't work so I can test it out? |
I see. But changing the scope to "provided" is the wrong way to go. You need to exclude unnecessary sub-module dependencies in your own project:
However, I am wondering if the statistics collection code is placed correctly into flink-contrib. I thought flink-contrib is a "parent" project only containing sub-modules. For this case, statistic collection would be an own sub-module and you could just include this sub-module into your dependencies (this resolves the problem naturally) |
The PR is still open and can be adapted. |
OK thanks for the remark. Although somewhat verbose, this solves my concrete issue. I wonder if the list can be exclusive, e.g. <!-- use Tweet input format -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-tweet-inputformat</artifactId>
<version>${project.version}</version>
</dependency> However, it still leaves the question what policy to use for flink-* based dependencies. As an example, if I want to include I therefore suggest to at least make this consistent with the quickstart poms and optionally set the scope of already included dependencies to |
I think the statistics collection pull request has been created before we splitted the Afaik it should be impossible to have a "pom"-type maven module which also contains code?! The quickstart's pom is setting the dependencies for the user correctly. Are the dependencies of "flink-contrib" overwriting the "provided" scope from the quickstart-generated poms? |
The PR from @tammymendt is outdated. The |
I think that setting the dependency to "provided" is something the user should do, because it actually depends on the user environment. |
OK then we can close the issue as wontfix. |
Okay, I've closed the JIRA. can you close the PR? |
No description provided.