Github user NicoK commented on the issue:

    https://github.com/apache/flink/pull/5900
  
    I'm pretty sure I got all this covered by using a separate "configuration": 
`myShadowJar` - not the standard dependency configuration*, but does the trick:
    Everything added to `myShadowJar` inside the `dependencies` gets added to 
the shaded jar (here: shadowJar), except for the explicit excludes which work 
with transitive dependencies as well (defined in the lines starting with 
`myShadowJar.exclude group:` where I included the same things as in the maven 
shade configuration of the quickstart). All user-code dependencies should be 
put into `myShadowJar` - maybe I should make this even more explicit in the 
gradle build file.
    
    - nothing is relocated - there's stuff packed into the jar and other stuff 
that isn't, that's it :) (should be the same - I did compare the jar with the 
one from maven with and without the kafka connector dependency as a test)
    
    - Flink core dependencies are excluded from the uber jar by not putting 
them into `myShadowJar`
    
    - with the trick of using `myShadowJar`, not only is IntelliJ able to run 
the job and the tests, it also runs from commandline
    
    * Unfortunately, I could not use the `shadow`/`compileOnly` dependency 
configurations which are standard for this in gradle because then the program 
would not run in IntelliJ or via `gradle run`. It would expect the environment 
to provide the dependencies which it does not there. Alternatives/fixes for 
this broke the transitive dependency exclusion which is, however, scheduled for 
some future version of the gradle shadow plugin. There a lot of enhancement 
requests in this regard, e.g. https://github.com/johnrengelman/shadow/issues/159


---

Reply via email to