[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-08-28 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16595377#comment-16595377
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

StephanEwen commented on issue #105: [FLINK-9222] add gradle quickstart script
URL: https://github.com/apache/flink-web/pull/105#issuecomment-416682415
 
 
   What do you think about adding this to the main Flink repository, like the 
Java/Scala project templates?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: Improvement
>  Components: Project Website, Quickstarts
>Reporter: Nico Kruber
>Assignee: Nico Kruber
>Priority: Critical
>  Labels: pull-request-available
>
> Having a proper project template helps a lot in getting dependencies right. 
> For example, setting the core dependencies to "provided", the connector / 
> library dependencies to "compile", etc.
> The Maven quickstarts are in good shape by now, but there is none for Gradle 
> and Gradle users to get this wrong quite often.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-08-16 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16582266#comment-16582266
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

NicoK commented on issue #105: [FLINK-9222] add gradle quickstart script
URL: https://github.com/apache/flink-web/pull/105#issuecomment-413484715
 
 
   FYI: I just also verified that `./gradlew test` works with the given project 
file, after adding a unit test and enabling junit4


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: Improvement
>  Components: Project Website, Quickstarts
>Reporter: Nico Kruber
>Assignee: Nico Kruber
>Priority: Critical
>  Labels: pull-request-available
>
> Having a proper project template helps a lot in getting dependencies right. 
> For example, setting the core dependencies to "provided", the connector / 
> library dependencies to "compile", etc.
> The Maven quickstarts are in good shape by now, but there is none for Gradle 
> and Gradle users to get this wrong quite often.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-08-15 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16581393#comment-16581393
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

NicoK commented on issue #105: [FLINK-9222] add gradle quickstart script
URL: https://github.com/apache/flink-web/pull/105#issuecomment-413273627
 
 
   Actually, I'd keep the difference in the case of the project name and the 
directory: we do print where the project is created and therefore it is fine 
(there are some more differences between project name and directory name 
because of file system limitations anyway)
   
   I fixed the other issues (in both PRs)


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: Improvement
>  Components: Project Website, Quickstarts
>Reporter: Nico Kruber
>Assignee: Nico Kruber
>Priority: Critical
>  Labels: pull-request-available
>
> Having a proper project template helps a lot in getting dependencies right. 
> For example, setting the core dependencies to "provided", the connector / 
> library dependencies to "compile", etc.
> The Maven quickstarts are in good shape by now, but there is none for Gradle 
> and Gradle users to get this wrong quite often.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-08-15 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16581352#comment-16581352
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

NicoK commented on a change in pull request #105: [FLINK-9222] add gradle 
quickstart script
URL: https://github.com/apache/flink-web/pull/105#discussion_r210336947
 
 

 ##
 File path: q/gradle-quickstart.sh
 ##
 @@ -0,0 +1,226 @@
+#!/bin/bash
+
+
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+declare -r TRUE=0
+declare -r FALSE=1
+
+# takes a string and returns true if it seems to represent "yes"
+function isYes() {
+  local x=$1
+  [ $x = "y" -o $x = "Y" -o $x = "yes" ] && echo $TRUE; return
+  echo $FALSE
+}
+
+function mkDir() {
+  local x=$1
+  echo ${x// /-} | tr '[:upper:]' '[:lower:]'
+}
+
+function mkPackage() {
+  local x=$1
+  echo ${x//./\/}
+}
+
+defaultProjectName="quickstart"
+defaultOrganization="org.myorg.quickstart"
+defaultVersion="0.1-SNAPSHOT"
+defaultScalaBinaryVersion="2.11"
+defaultFlinkVersion="1.6-SNAPSHOT"
+
+echo "This script creates a Flink project using Java and Gradle."
+
+while [ $TRUE ]; do
+
+  echo ""
+  read -p "Project name ($defaultProjectName): " projectName
+  projectName=${projectName:-$defaultProjectName}
+  read -p "Organization ($defaultOrganization): " organization
+  organization=${organization:-$defaultOrganization}
+  read -p "Version ($defaultVersion): " version
+  version=${version:-$defaultVersion}
+  read -p "Scala version ($defaultScalaBinaryVersion): " scalaBinaryVersion
+  scalaBinaryVersion=${scalaBinaryVersion:-$defaultScalaBinaryVersion}
+  read -p "Flink version ($defaultFlinkVersion): " flinkVersion
+  flinkVersion=${flinkVersion:-$defaultFlinkVersion}
+
+  echo ""
+  echo "---"
+  echo "Project Name: ${projectName}"
+  echo "Organization: ${organization}"
+  echo "Version: ${version}"
+  echo "Scala binary version: ${scalaBinaryVersion}"
+  echo "Flink version: ${flinkVersion}"
+  echo "---"
+  read -p "Create Project? (Y/n): " createProject
+  createProject=${createProject:-y}
+
+  [ "$(isYes "${createProject}")" = "$TRUE" ] && break
+
+done
+
+directoryName=$(mkDir "${projectName}")
+
+echo "Creating Flink project under ${directoryName}"
+
+mkdir -p ${directoryName}
+cd ${directoryName}
+
+# Create the README file
+
+cat > README < Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: Improvement
>  Components: Project Website, Quickstarts
>Reporter: Nico Kruber
>Assignee: Nico Kruber
>Priority: Critical
>  Labels: pull-request-available
>
> Having a proper project template helps a lot in getting dependencies right. 
> For example, setting the core dependencies to "provided", the connector / 
> library dependencies to "compile", etc.
> The Maven quickstarts are in good shape by now, but there is none for Gradle 
> and Gradle users to get this wrong quite often.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-08-13 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16578467#comment-16578467
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

twalthr commented on a change in pull request #105: [FLINK-9222] add gradle 
quickstart script
URL: https://github.com/apache/flink-web/pull/105#discussion_r209653708
 
 

 ##
 File path: q/gradle-quickstart.sh
 ##
 @@ -0,0 +1,226 @@
+#!/bin/bash
+
+
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+declare -r TRUE=0
+declare -r FALSE=1
+
+# takes a string and returns true if it seems to represent "yes"
+function isYes() {
+  local x=$1
+  [ $x = "y" -o $x = "Y" -o $x = "yes" ] && echo $TRUE; return
+  echo $FALSE
+}
+
+function mkDir() {
+  local x=$1
+  echo ${x// /-} | tr '[:upper:]' '[:lower:]'
+}
+
+function mkPackage() {
+  local x=$1
+  echo ${x//./\/}
+}
+
+defaultProjectName="quickstart"
+defaultOrganization="org.myorg.quickstart"
+defaultVersion="0.1-SNAPSHOT"
+defaultScalaBinaryVersion="2.11"
+defaultFlinkVersion="1.6-SNAPSHOT"
+
+echo "This script creates a Flink project using Java and Gradle."
+
+while [ $TRUE ]; do
+
+  echo ""
+  read -p "Project name ($defaultProjectName): " projectName
+  projectName=${projectName:-$defaultProjectName}
+  read -p "Organization ($defaultOrganization): " organization
+  organization=${organization:-$defaultOrganization}
+  read -p "Version ($defaultVersion): " version
+  version=${version:-$defaultVersion}
+  read -p "Scala version ($defaultScalaBinaryVersion): " scalaBinaryVersion
+  scalaBinaryVersion=${scalaBinaryVersion:-$defaultScalaBinaryVersion}
+  read -p "Flink version ($defaultFlinkVersion): " flinkVersion
+  flinkVersion=${flinkVersion:-$defaultFlinkVersion}
+
+  echo ""
+  echo "---"
+  echo "Project Name: ${projectName}"
+  echo "Organization: ${organization}"
+  echo "Version: ${version}"
+  echo "Scala binary version: ${scalaBinaryVersion}"
+  echo "Flink version: ${flinkVersion}"
+  echo "---"
+  read -p "Create Project? (Y/n): " createProject
+  createProject=${createProject:-y}
+
+  [ "$(isYes "${createProject}")" = "$TRUE" ] && break
+
+done
+
+directoryName=$(mkDir "${projectName}")
+
+echo "Creating Flink project under ${directoryName}"
+
+mkdir -p ${directoryName}
+cd ${directoryName}
+
+# Create the README file
+
+cat > README < settings.gradle < build.gradle  Explicitly define the // libraries we want to be included in the 
"flinkShadowJar" configuration!
+configurations {
+flinkShadowJar // dependencies which go into the shadowJar
+
+// always exclude these (also from transitive dependencies) since they are 
provided by Flink
+flinkShadowJar.exclude group: 'org.apache.flink', module: 'force-shading'
+flinkShadowJar.exclude group: 'com.google.code.findbugs', module: 'jsr305'
+flinkShadowJar.exclude group: 'org.slf4j'
+flinkShadowJar.exclude group: 'log4j'
+}
+
+// declare the dependencies for your production and test code
+dependencies {
+compile "org.apache.flink:flink-java:\${flinkVersion}"
+compile 
"org.apache.flink:flink-streaming-java_\${scalaBinaryVersion}:\${flinkVersion}"
+
+// Add connector dependencies here.
 
 Review comment:
   Not only `connector`. In general I would make this section more prominent. 
Maybe using
   ```
   // --
   // Add dependencies here that should NOT be part of the 
   // shadow jar and are provided in the lib folder of Flink
   // --
   ...
   // 

[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-08-13 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16578466#comment-16578466
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

twalthr commented on a change in pull request #105: [FLINK-9222] add gradle 
quickstart script
URL: https://github.com/apache/flink-web/pull/105#discussion_r209652918
 
 

 ##
 File path: q/gradle-quickstart.sh
 ##
 @@ -0,0 +1,226 @@
+#!/bin/bash
+
+
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+declare -r TRUE=0
+declare -r FALSE=1
+
+# takes a string and returns true if it seems to represent "yes"
+function isYes() {
+  local x=$1
+  [ $x = "y" -o $x = "Y" -o $x = "yes" ] && echo $TRUE; return
+  echo $FALSE
+}
+
+function mkDir() {
+  local x=$1
+  echo ${x// /-} | tr '[:upper:]' '[:lower:]'
+}
+
+function mkPackage() {
+  local x=$1
+  echo ${x//./\/}
+}
+
+defaultProjectName="quickstart"
+defaultOrganization="org.myorg.quickstart"
+defaultVersion="0.1-SNAPSHOT"
+defaultScalaBinaryVersion="2.11"
+defaultFlinkVersion="1.6-SNAPSHOT"
+
+echo "This script creates a Flink project using Java and Gradle."
+
+while [ $TRUE ]; do
+
+  echo ""
+  read -p "Project name ($defaultProjectName): " projectName
+  projectName=${projectName:-$defaultProjectName}
+  read -p "Organization ($defaultOrganization): " organization
+  organization=${organization:-$defaultOrganization}
+  read -p "Version ($defaultVersion): " version
+  version=${version:-$defaultVersion}
+  read -p "Scala version ($defaultScalaBinaryVersion): " scalaBinaryVersion
+  scalaBinaryVersion=${scalaBinaryVersion:-$defaultScalaBinaryVersion}
+  read -p "Flink version ($defaultFlinkVersion): " flinkVersion
+  flinkVersion=${flinkVersion:-$defaultFlinkVersion}
+
+  echo ""
+  echo "---"
+  echo "Project Name: ${projectName}"
+  echo "Organization: ${organization}"
+  echo "Version: ${version}"
+  echo "Scala binary version: ${scalaBinaryVersion}"
+  echo "Flink version: ${flinkVersion}"
+  echo "---"
+  read -p "Create Project? (Y/n): " createProject
+  createProject=${createProject:-y}
+
+  [ "$(isYes "${createProject}")" = "$TRUE" ] && break
+
+done
+
+directoryName=$(mkDir "${projectName}")
+
+echo "Creating Flink project under ${directoryName}"
+
+mkdir -p ${directoryName}
+cd ${directoryName}
+
+# Create the README file
+
+cat > README < Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: Improvement
>  Components: Project Website, Quickstarts
>Reporter: Nico Kruber
>Assignee: Nico Kruber
>Priority: Critical
>  Labels: pull-request-available
>
> Having a proper project template helps a lot in getting dependencies right. 
> For example, setting the core dependencies to "provided", the connector / 
> library dependencies to "compile", etc.
> The Maven quickstarts are in good shape by now, but there is none for Gradle 
> and Gradle users to get this wrong quite often.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-08-08 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16573159#comment-16573159
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

NicoK commented on issue #5900: [FLINK-9222][docs] add documentation for 
setting up Gradle projects
URL: https://github.com/apache/flink/pull/5900#issuecomment-411390743
 
 
   @twalthr ping


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: Improvement
>  Components: Project Website, Quickstarts
>Reporter: Nico Kruber
>Assignee: Nico Kruber
>Priority: Critical
>  Labels: pull-request-available
>
> Having a proper project template helps a lot in getting dependencies right. 
> For example, setting the core dependencies to "provided", the connector / 
> library dependencies to "compile", etc.
> The Maven quickstarts are in good shape by now, but there is none for Gradle 
> and Gradle users to get this wrong quite often.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-07-12 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16541775#comment-16541775
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user NicoK commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r202066470
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -101,23 +111,210 @@ allows to [import Maven 
projects](http://books.sonatype.com/m2eclipse-book/refer
 Some Eclipse bundles include that plugin by default, others require you
 to install it manually. 
 
-*A note to Mac OS X users*: The default JVM heapsize for Java may be too
+*Please note*: The default JVM heapsize for Java may be too
 small for Flink. You have to manually increase it.
-In Eclipse, choose
-`Run Configurations -> Arguments` and write into the `VM Arguments`
-box: `-Xmx800m`.
+In Eclipse, choose `Run Configurations -> Arguments` and write into the 
`VM Arguments` box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.4'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '{{ site.version }}'
+scalaBinaryVersion = '{{ site.scala_version }}'
+slf4jVersion = '1.7.7'
+log4jVersion = '1.2.17'
+}
+
+
+sourceCompatibility = javaVersion
+targetCompatibility = javaVersion
+tasks.withType(JavaCompile) {
+   options.encoding = 'UTF-8'
+}
+
+applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
+
+// declare where to find the dependencies of your project
+repositories {
+mavenCentral()
+maven { url 
"https://repository.apache.org/content/repositories/snapshots/; }
+}
+
+// NOTE: We cannot use "compileOnly" or "shadow" configurations since then 
we could not run code
+// in the IDE or with "gradle run". We also cannot exclude transitive 
dependencies from the
+// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
+// -> Explicitly define the // libraries we want to be included in the 
"flinkShadowJar" configuration!
+configurations {
+flinkShadowJar // dependencies which go into the shadowJar
+
+// always exclude these (also from transitive dependencies) since they 
are provided by Flink
+flinkShadowJar.exclude group: 'org.apache.flink', module: 
'force-shading'
+flinkShadowJar.exclude group: 'com.google.code.findbugs', module: 
'jsr305'
+flinkShadowJar.exclude group: 'org.slf4j'
+flinkShadowJar.exclude group: 'log4j'
+}
+
+// declare the dependencies for your production and 

[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-07-12 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16541755#comment-16541755
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user k-mack commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r202062325
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -101,23 +111,210 @@ allows to [import Maven 
projects](http://books.sonatype.com/m2eclipse-book/refer
 Some Eclipse bundles include that plugin by default, others require you
 to install it manually. 
 
-*A note to Mac OS X users*: The default JVM heapsize for Java may be too
+*Please note*: The default JVM heapsize for Java may be too
 small for Flink. You have to manually increase it.
-In Eclipse, choose
-`Run Configurations -> Arguments` and write into the `VM Arguments`
-box: `-Xmx800m`.
+In Eclipse, choose `Run Configurations -> Arguments` and write into the 
`VM Arguments` box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.4'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '{{ site.version }}'
+scalaBinaryVersion = '{{ site.scala_version }}'
+slf4jVersion = '1.7.7'
+log4jVersion = '1.2.17'
+}
+
+
+sourceCompatibility = javaVersion
+targetCompatibility = javaVersion
+tasks.withType(JavaCompile) {
+   options.encoding = 'UTF-8'
+}
+
+applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
+
+// declare where to find the dependencies of your project
+repositories {
+mavenCentral()
+maven { url 
"https://repository.apache.org/content/repositories/snapshots/; }
+}
+
+// NOTE: We cannot use "compileOnly" or "shadow" configurations since then 
we could not run code
+// in the IDE or with "gradle run". We also cannot exclude transitive 
dependencies from the
+// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
+// -> Explicitly define the // libraries we want to be included in the 
"flinkShadowJar" configuration!
+configurations {
+flinkShadowJar // dependencies which go into the shadowJar
+
+// always exclude these (also from transitive dependencies) since they 
are provided by Flink
+flinkShadowJar.exclude group: 'org.apache.flink', module: 
'force-shading'
+flinkShadowJar.exclude group: 'com.google.code.findbugs', module: 
'jsr305'
+flinkShadowJar.exclude group: 'org.slf4j'
+flinkShadowJar.exclude group: 'log4j'
+}
+
+// declare the dependencies for your production 

[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-07-12 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16541365#comment-16541365
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user NicoK commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r201965094
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -101,23 +111,210 @@ allows to [import Maven 
projects](http://books.sonatype.com/m2eclipse-book/refer
 Some Eclipse bundles include that plugin by default, others require you
 to install it manually. 
 
-*A note to Mac OS X users*: The default JVM heapsize for Java may be too
+*Please note*: The default JVM heapsize for Java may be too
 small for Flink. You have to manually increase it.
-In Eclipse, choose
-`Run Configurations -> Arguments` and write into the `VM Arguments`
-box: `-Xmx800m`.
+In Eclipse, choose `Run Configurations -> Arguments` and write into the 
`VM Arguments` box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.4'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '{{ site.version }}'
+scalaBinaryVersion = '{{ site.scala_version }}'
+slf4jVersion = '1.7.7'
+log4jVersion = '1.2.17'
+}
+
+
+sourceCompatibility = javaVersion
+targetCompatibility = javaVersion
+tasks.withType(JavaCompile) {
+   options.encoding = 'UTF-8'
+}
+
+applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
+
+// declare where to find the dependencies of your project
+repositories {
+mavenCentral()
+maven { url 
"https://repository.apache.org/content/repositories/snapshots/; }
+}
+
+// NOTE: We cannot use "compileOnly" or "shadow" configurations since then 
we could not run code
+// in the IDE or with "gradle run". We also cannot exclude transitive 
dependencies from the
+// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
+// -> Explicitly define the // libraries we want to be included in the 
"flinkShadowJar" configuration!
+configurations {
+flinkShadowJar // dependencies which go into the shadowJar
+
+// always exclude these (also from transitive dependencies) since they 
are provided by Flink
+flinkShadowJar.exclude group: 'org.apache.flink', module: 
'force-shading'
+flinkShadowJar.exclude group: 'com.google.code.findbugs', module: 
'jsr305'
+flinkShadowJar.exclude group: 'org.slf4j'
+flinkShadowJar.exclude group: 'log4j'
+}
+
+// declare the dependencies for your production and 

[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-07-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16540281#comment-16540281
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user k-mack commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r201746359
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -101,23 +111,210 @@ allows to [import Maven 
projects](http://books.sonatype.com/m2eclipse-book/refer
 Some Eclipse bundles include that plugin by default, others require you
 to install it manually. 
 
-*A note to Mac OS X users*: The default JVM heapsize for Java may be too
+*Please note*: The default JVM heapsize for Java may be too
 small for Flink. You have to manually increase it.
-In Eclipse, choose
-`Run Configurations -> Arguments` and write into the `VM Arguments`
-box: `-Xmx800m`.
+In Eclipse, choose `Run Configurations -> Arguments` and write into the 
`VM Arguments` box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.4'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '{{ site.version }}'
+scalaBinaryVersion = '{{ site.scala_version }}'
+slf4jVersion = '1.7.7'
+log4jVersion = '1.2.17'
+}
+
+
+sourceCompatibility = javaVersion
+targetCompatibility = javaVersion
+tasks.withType(JavaCompile) {
+   options.encoding = 'UTF-8'
+}
+
+applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
+
+// declare where to find the dependencies of your project
+repositories {
+mavenCentral()
+maven { url 
"https://repository.apache.org/content/repositories/snapshots/; }
+}
+
+// NOTE: We cannot use "compileOnly" or "shadow" configurations since then 
we could not run code
+// in the IDE or with "gradle run". We also cannot exclude transitive 
dependencies from the
+// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
+// -> Explicitly define the // libraries we want to be included in the 
"flinkShadowJar" configuration!
+configurations {
+flinkShadowJar // dependencies which go into the shadowJar
+
+// always exclude these (also from transitive dependencies) since they 
are provided by Flink
+flinkShadowJar.exclude group: 'org.apache.flink', module: 
'force-shading'
+flinkShadowJar.exclude group: 'com.google.code.findbugs', module: 
'jsr305'
+flinkShadowJar.exclude group: 'org.slf4j'
+flinkShadowJar.exclude group: 'log4j'
+}
+
+// declare the dependencies for your production 

[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-07-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16538465#comment-16538465
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user NicoK commented on the issue:

https://github.com/apache/flink/pull/5900
  
Hi @twalthr,
I just created a fixup commit for this PR and the one for `flink-web`. Can 
you have a second look?


> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: Improvement
>  Components: Project Website, Quickstarts
>Reporter: Nico Kruber
>Assignee: Nico Kruber
>Priority: Critical
>  Labels: pull-request-available
>
> Having a proper project template helps a lot in getting dependencies right. 
> For example, setting the core dependencies to "provided", the connector / 
> library dependencies to "compile", etc.
> The Maven quickstarts are in good shape by now, but there is none for Gradle 
> and Gradle users to get this wrong quite often.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-07-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16538444#comment-16538444
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user NicoK commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r201310579
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -108,16 +118,201 @@ In Eclipse, choose
 box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.3'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '1.6-SNAPSHOT'
+scalaBinaryVersion = '2.11'
+slf4jVersion = '1.7.7'
+log4jVersion = '1.2.17'
+}
+
+
+sourceCompatibility = javaVersion
+targetCompatibility = javaVersion
+tasks.withType(JavaCompile) {
+   options.encoding = 'UTF-8'
+}
+
+applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
+
+// declare where to find the dependencies of your project
+repositories {
+mavenCentral()
+maven { url 
"https://repository.apache.org/content/repositories/snapshots/; }
+}
+
+// NOTE: We cannot use "compileOnly" or "shadow" configurations since then 
we could not run code
+// in the IDE or with "gradle run". We also cannot exclude transitive 
dependencies from the
+// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
+// -> Explicitly define the // libraries we want to be included in the 
"myShadowJar" configuration!
+configurations {
+myShadowJar // dependencies which go into the shadowJar
+
+// always exclude these (also from transitive dependencies) since they 
are provided by Flink
+myShadowJar.exclude group: 'org.apache.flink', module: 'force-shading'
+myShadowJar.exclude group: 'com.google.code.findbugs', module: 'jsr305'
+myShadowJar.exclude group: 'org.slf4j'
+myShadowJar.exclude group: 'log4j'
+}
+
+// declare the dependencies for your production and test code
+dependencies {
+compile "org.apache.flink:flink-java:${flinkVersion}"
+compile 
"org.apache.flink:flink-streaming-java_${scalaBinaryVersion}:${flinkVersion}"
+
+//myShadowJar 
"org.apache.flink:flink-connector-kafka-0.11_${scalaBinaryVersion}:${flinkVersion}"
+
+compile "log4j:log4j:${log4jVersion}"
+compile "org.slf4j:slf4j-log4j12:${slf4jVersion}"
+
+testCompile "junit:junit:4.12"
+}
+
+// make compileOnly dependencies available for tests:
+sourceSets {
+main.runtimeClasspath += configurations.myShadowJar
+

[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-07-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16538345#comment-16538345
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user NicoK commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r201286036
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -108,16 +118,201 @@ In Eclipse, choose
 box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.3'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '1.6-SNAPSHOT'
+scalaBinaryVersion = '2.11'
+slf4jVersion = '1.7.7'
+log4jVersion = '1.2.17'
+}
+
+
+sourceCompatibility = javaVersion
+targetCompatibility = javaVersion
+tasks.withType(JavaCompile) {
+   options.encoding = 'UTF-8'
+}
+
+applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
+
+// declare where to find the dependencies of your project
+repositories {
+mavenCentral()
+maven { url 
"https://repository.apache.org/content/repositories/snapshots/; }
+}
+
+// NOTE: We cannot use "compileOnly" or "shadow" configurations since then 
we could not run code
+// in the IDE or with "gradle run". We also cannot exclude transitive 
dependencies from the
+// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
--- End diff --

Thanks for this tip, unfortunately, this still leaves us with the inability 
to exclude transitive dependencies from the shaded jar, i.e.
```
flinkShadowJar.exclude group: 'org.apache.flink', module: 
'force-shading'
flinkShadowJar.exclude group: 'com.google.code.findbugs', module: 
'jsr305'
flinkShadowJar.exclude group: 'org.slf4j'
flinkShadowJar.exclude group: 'log4j'
```

Therefore, we still need the workaround with our own configuration for 
dependencies that go into the shaded jar.


> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: Improvement
>  Components: Project Website, Quickstarts
>Reporter: Nico Kruber
>Assignee: Nico Kruber
>Priority: Critical
>  Labels: pull-request-available
>
> Having a proper project template helps a lot in getting dependencies right. 
> For example, setting the core dependencies to "provided", the connector / 
> library dependencies to "compile", etc.
> The Maven quickstarts are in good shape by now, but 

[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-06-25 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16522038#comment-16522038
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user imrel commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r197720653
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -108,16 +118,201 @@ In Eclipse, choose
 box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.3'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '1.6-SNAPSHOT'
+scalaBinaryVersion = '2.11'
+slf4jVersion = '1.7.7'
+log4jVersion = '1.2.17'
+}
+
+
+sourceCompatibility = javaVersion
+targetCompatibility = javaVersion
+tasks.withType(JavaCompile) {
+   options.encoding = 'UTF-8'
+}
+
+applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
+
+// declare where to find the dependencies of your project
+repositories {
+mavenCentral()
+maven { url 
"https://repository.apache.org/content/repositories/snapshots/; }
+}
+
+// NOTE: We cannot use "compileOnly" or "shadow" configurations since then 
we could not run code
+// in the IDE or with "gradle run". We also cannot exclude transitive 
dependencies from the
+// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
--- End diff --

compileOnly for provided dependencies works good for me, 
for running in IDEA i select checkbox "include provided dependencies" on 
run configuration and for tests i add this: 
configurations {
testCompile.extendsFrom compileOnly
}



> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: Improvement
>  Components: Project Website, Quickstarts
>Reporter: Nico Kruber
>Assignee: Nico Kruber
>Priority: Critical
>  Labels: pull-request-available
>
> Having a proper project template helps a lot in getting dependencies right. 
> For example, setting the core dependencies to "provided", the connector / 
> library dependencies to "compile", etc.
> The Maven quickstarts are in good shape by now, but there is none for Gradle 
> and Gradle users to get this wrong quite often.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-06-12 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16510291#comment-16510291
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user NicoK commented on the issue:

https://github.com/apache/flink/pull/5900
  
Thanks for the review, Timo.
Regarding the copy of the gradle build file: since we did not really have a 
pristine version (only one that is generated by the shell script) I wanted to 
put one somewhere for users who don't won't/trust the shell script :) 
Alternatively, we could put this up for download in flink-web as well, but the 
visibility is not the same as it is when having it included in the docs.


> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: Improvement
>  Components: Project Website, Quickstarts
>Reporter: Nico Kruber
>Assignee: Nico Kruber
>Priority: Critical
>
> Having a proper project template helps a lot in getting dependencies right. 
> For example, setting the core dependencies to "provided", the connector / 
> library dependencies to "compile", etc.
> The Maven quickstarts are in good shape by now, but there is none for Gradle 
> and Gradle users to get this wrong quite often.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-06-12 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16510286#comment-16510286
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user NicoK commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r194902416
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -108,16 +118,201 @@ In Eclipse, choose
 box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.3'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '1.6-SNAPSHOT'
+scalaBinaryVersion = '2.11'
+slf4jVersion = '1.7.7'
+log4jVersion = '1.2.17'
+}
+
+
+sourceCompatibility = javaVersion
+targetCompatibility = javaVersion
+tasks.withType(JavaCompile) {
+   options.encoding = 'UTF-8'
+}
+
+applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
+
+// declare where to find the dependencies of your project
+repositories {
+mavenCentral()
+maven { url 
"https://repository.apache.org/content/repositories/snapshots/; }
+}
+
+// NOTE: We cannot use "compileOnly" or "shadow" configurations since then 
we could not run code
+// in the IDE or with "gradle run". We also cannot exclude transitive 
dependencies from the
+// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
+// -> Explicitly define the // libraries we want to be included in the 
"myShadowJar" configuration!
+configurations {
+myShadowJar // dependencies which go into the shadowJar
+
+// always exclude these (also from transitive dependencies) since they 
are provided by Flink
+myShadowJar.exclude group: 'org.apache.flink', module: 'force-shading'
+myShadowJar.exclude group: 'com.google.code.findbugs', module: 'jsr305'
+myShadowJar.exclude group: 'org.slf4j'
+myShadowJar.exclude group: 'log4j'
+}
+
+// declare the dependencies for your production and test code
+dependencies {
+compile "org.apache.flink:flink-java:${flinkVersion}"
+compile 
"org.apache.flink:flink-streaming-java_${scalaBinaryVersion}:${flinkVersion}"
+
+//myShadowJar 
"org.apache.flink:flink-connector-kafka-0.11_${scalaBinaryVersion}:${flinkVersion}"
+
+compile "log4j:log4j:${log4jVersion}"
+compile "org.slf4j:slf4j-log4j12:${slf4jVersion}"
+
+testCompile "junit:junit:4.12"
--- End diff --

yes, this should probably be a commented-out example dependency as well


> Add a Gradle Quickstart
> ---
>
> 

[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-06-12 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16510284#comment-16510284
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user NicoK commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r194902217
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -108,16 +118,201 @@ In Eclipse, choose
 box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.3'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '1.6-SNAPSHOT'
+scalaBinaryVersion = '2.11'
+slf4jVersion = '1.7.7'
+log4jVersion = '1.2.17'
+}
+
+
+sourceCompatibility = javaVersion
+targetCompatibility = javaVersion
+tasks.withType(JavaCompile) {
+   options.encoding = 'UTF-8'
+}
+
+applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
+
+// declare where to find the dependencies of your project
+repositories {
+mavenCentral()
+maven { url 
"https://repository.apache.org/content/repositories/snapshots/; }
+}
+
+// NOTE: We cannot use "compileOnly" or "shadow" configurations since then 
we could not run code
+// in the IDE or with "gradle run". We also cannot exclude transitive 
dependencies from the
+// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
+// -> Explicitly define the // libraries we want to be included in the 
"myShadowJar" configuration!
+configurations {
+myShadowJar // dependencies which go into the shadowJar
+
+// always exclude these (also from transitive dependencies) since they 
are provided by Flink
+myShadowJar.exclude group: 'org.apache.flink', module: 'force-shading'
+myShadowJar.exclude group: 'com.google.code.findbugs', module: 'jsr305'
+myShadowJar.exclude group: 'org.slf4j'
+myShadowJar.exclude group: 'log4j'
+}
+
+// declare the dependencies for your production and test code
+dependencies {
--- End diff --

I'm not sure this is possible...


> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: Improvement
>  Components: Project Website, Quickstarts
>Reporter: Nico Kruber
>Assignee: Nico Kruber
>Priority: Critical
>
> Having a proper project template helps a lot in getting dependencies right. 
> For example, setting the core dependencies to "provided", the connector 

[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-06-12 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16510281#comment-16510281
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user NicoK commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r194901682
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -108,16 +118,201 @@ In Eclipse, choose
 box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.3'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '1.6-SNAPSHOT'
+scalaBinaryVersion = '2.11'
+slf4jVersion = '1.7.7'
+log4jVersion = '1.2.17'
+}
+
+
+sourceCompatibility = javaVersion
+targetCompatibility = javaVersion
+tasks.withType(JavaCompile) {
+   options.encoding = 'UTF-8'
+}
+
+applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
+
+// declare where to find the dependencies of your project
+repositories {
+mavenCentral()
+maven { url 
"https://repository.apache.org/content/repositories/snapshots/; }
+}
+
+// NOTE: We cannot use "compileOnly" or "shadow" configurations since then 
we could not run code
+// in the IDE or with "gradle run". We also cannot exclude transitive 
dependencies from the
+// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
+// -> Explicitly define the // libraries we want to be included in the 
"myShadowJar" configuration!
+configurations {
+myShadowJar // dependencies which go into the shadowJar
+
+// always exclude these (also from transitive dependencies) since they 
are provided by Flink
+myShadowJar.exclude group: 'org.apache.flink', module: 'force-shading'
+myShadowJar.exclude group: 'com.google.code.findbugs', module: 'jsr305'
+myShadowJar.exclude group: 'org.slf4j'
+myShadowJar.exclude group: 'log4j'
+}
+
+// declare the dependencies for your production and test code
+dependencies {
+compile "org.apache.flink:flink-java:${flinkVersion}"
+compile 
"org.apache.flink:flink-streaming-java_${scalaBinaryVersion}:${flinkVersion}"
+
+//myShadowJar 
"org.apache.flink:flink-connector-kafka-0.11_${scalaBinaryVersion}:${flinkVersion}"
+
+compile "log4j:log4j:${log4jVersion}"
+compile "org.slf4j:slf4j-log4j12:${slf4jVersion}"
+
+testCompile "junit:junit:4.12"
+}
+
+// make compileOnly dependencies available for tests:
+sourceSets {
+main.runtimeClasspath += configurations.myShadowJar
+

[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-06-12 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16510280#comment-16510280
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user NicoK commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r194901455
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -108,16 +118,201 @@ In Eclipse, choose
 box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.3'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '1.6-SNAPSHOT'
+scalaBinaryVersion = '2.11'
+slf4jVersion = '1.7.7'
+log4jVersion = '1.2.17'
+}
+
+
+sourceCompatibility = javaVersion
+targetCompatibility = javaVersion
+tasks.withType(JavaCompile) {
+   options.encoding = 'UTF-8'
+}
+
+applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
+
+// declare where to find the dependencies of your project
+repositories {
+mavenCentral()
+maven { url 
"https://repository.apache.org/content/repositories/snapshots/; }
+}
+
+// NOTE: We cannot use "compileOnly" or "shadow" configurations since then 
we could not run code
+// in the IDE or with "gradle run". We also cannot exclude transitive 
dependencies from the
+// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
+// -> Explicitly define the // libraries we want to be included in the 
"myShadowJar" configuration!
+configurations {
+myShadowJar // dependencies which go into the shadowJar
+
+// always exclude these (also from transitive dependencies) since they 
are provided by Flink
+myShadowJar.exclude group: 'org.apache.flink', module: 'force-shading'
+myShadowJar.exclude group: 'com.google.code.findbugs', module: 'jsr305'
+myShadowJar.exclude group: 'org.slf4j'
+myShadowJar.exclude group: 'log4j'
+}
+
+// declare the dependencies for your production and test code
+dependencies {
+compile "org.apache.flink:flink-java:${flinkVersion}"
+compile 
"org.apache.flink:flink-streaming-java_${scalaBinaryVersion}:${flinkVersion}"
+
+//myShadowJar 
"org.apache.flink:flink-connector-kafka-0.11_${scalaBinaryVersion}:${flinkVersion}"
+
+compile "log4j:log4j:${log4jVersion}"
+compile "org.slf4j:slf4j-log4j12:${slf4jVersion}"
+
+testCompile "junit:junit:4.12"
+}
+
+// make compileOnly dependencies available for tests:
+sourceSets {
+main.runtimeClasspath += configurations.myShadowJar
+

[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-06-12 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16510272#comment-16510272
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user NicoK commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r194900846
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -108,16 +118,201 @@ In Eclipse, choose
 box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.3'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '1.6-SNAPSHOT'
+scalaBinaryVersion = '2.11'
+slf4jVersion = '1.7.7'
+log4jVersion = '1.2.17'
+}
+
+
+sourceCompatibility = javaVersion
+targetCompatibility = javaVersion
+tasks.withType(JavaCompile) {
+   options.encoding = 'UTF-8'
+}
+
+applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
+
+// declare where to find the dependencies of your project
+repositories {
+mavenCentral()
+maven { url 
"https://repository.apache.org/content/repositories/snapshots/; }
+}
+
+// NOTE: We cannot use "compileOnly" or "shadow" configurations since then 
we could not run code
+// in the IDE or with "gradle run". We also cannot exclude transitive 
dependencies from the
+// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
+// -> Explicitly define the // libraries we want to be included in the 
"myShadowJar" configuration!
+configurations {
+myShadowJar // dependencies which go into the shadowJar
+
+// always exclude these (also from transitive dependencies) since they 
are provided by Flink
+myShadowJar.exclude group: 'org.apache.flink', module: 'force-shading'
+myShadowJar.exclude group: 'com.google.code.findbugs', module: 'jsr305'
+myShadowJar.exclude group: 'org.slf4j'
+myShadowJar.exclude group: 'log4j'
+}
+
+// declare the dependencies for your production and test code
+dependencies {
+compile "org.apache.flink:flink-java:${flinkVersion}"
+compile 
"org.apache.flink:flink-streaming-java_${scalaBinaryVersion}:${flinkVersion}"
+
+//myShadowJar 
"org.apache.flink:flink-connector-kafka-0.11_${scalaBinaryVersion}:${flinkVersion}"
--- End diff --

yes, this example should be extended with a comment just like in the 
pom.xml file for Java: ``


> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>

[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-06-12 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16510269#comment-16510269
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user NicoK commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r194900211
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -108,16 +118,201 @@ In Eclipse, choose
 box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.3'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '1.6-SNAPSHOT'
+scalaBinaryVersion = '2.11'
+slf4jVersion = '1.7.7'
+log4jVersion = '1.2.17'
+}
+
+
+sourceCompatibility = javaVersion
+targetCompatibility = javaVersion
+tasks.withType(JavaCompile) {
+   options.encoding = 'UTF-8'
+}
+
+applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
+
+// declare where to find the dependencies of your project
+repositories {
+mavenCentral()
+maven { url 
"https://repository.apache.org/content/repositories/snapshots/; }
+}
+
+// NOTE: We cannot use "compileOnly" or "shadow" configurations since then 
we could not run code
+// in the IDE or with "gradle run". We also cannot exclude transitive 
dependencies from the
+// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
+// -> Explicitly define the // libraries we want to be included in the 
"myShadowJar" configuration!
+configurations {
+myShadowJar // dependencies which go into the shadowJar
--- End diff --

that's actually a good idea


> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: Improvement
>  Components: Project Website, Quickstarts
>Reporter: Nico Kruber
>Assignee: Nico Kruber
>Priority: Critical
>
> Having a proper project template helps a lot in getting dependencies right. 
> For example, setting the core dependencies to "provided", the connector / 
> library dependencies to "compile", etc.
> The Maven quickstarts are in good shape by now, but there is none for Gradle 
> and Gradle users to get this wrong quite often.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-06-12 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16509554#comment-16509554
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user twalthr commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r194708090
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -108,16 +118,201 @@ In Eclipse, choose
 box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.3'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '1.6-SNAPSHOT'
+scalaBinaryVersion = '2.11'
+slf4jVersion = '1.7.7'
+log4jVersion = '1.2.17'
+}
+
+
+sourceCompatibility = javaVersion
+targetCompatibility = javaVersion
+tasks.withType(JavaCompile) {
+   options.encoding = 'UTF-8'
+}
+
+applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
+
+// declare where to find the dependencies of your project
+repositories {
+mavenCentral()
+maven { url 
"https://repository.apache.org/content/repositories/snapshots/; }
+}
+
+// NOTE: We cannot use "compileOnly" or "shadow" configurations since then 
we could not run code
+// in the IDE or with "gradle run". We also cannot exclude transitive 
dependencies from the
+// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
+// -> Explicitly define the // libraries we want to be included in the 
"myShadowJar" configuration!
+configurations {
+myShadowJar // dependencies which go into the shadowJar
+
+// always exclude these (also from transitive dependencies) since they 
are provided by Flink
+myShadowJar.exclude group: 'org.apache.flink', module: 'force-shading'
+myShadowJar.exclude group: 'com.google.code.findbugs', module: 'jsr305'
+myShadowJar.exclude group: 'org.slf4j'
+myShadowJar.exclude group: 'log4j'
+}
+
+// declare the dependencies for your production and test code
+dependencies {
+compile "org.apache.flink:flink-java:${flinkVersion}"
+compile 
"org.apache.flink:flink-streaming-java_${scalaBinaryVersion}:${flinkVersion}"
+
+//myShadowJar 
"org.apache.flink:flink-connector-kafka-0.11_${scalaBinaryVersion}:${flinkVersion}"
+
+compile "log4j:log4j:${log4jVersion}"
+compile "org.slf4j:slf4j-log4j12:${slf4jVersion}"
+
+testCompile "junit:junit:4.12"
+}
+
+// make compileOnly dependencies available for tests:
+sourceSets {
+main.runtimeClasspath += configurations.myShadowJar
+

[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-06-12 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16509549#comment-16509549
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user twalthr commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r194707580
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -108,16 +118,201 @@ In Eclipse, choose
 box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.3'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '1.6-SNAPSHOT'
+scalaBinaryVersion = '2.11'
+slf4jVersion = '1.7.7'
+log4jVersion = '1.2.17'
+}
+
+
+sourceCompatibility = javaVersion
+targetCompatibility = javaVersion
+tasks.withType(JavaCompile) {
+   options.encoding = 'UTF-8'
+}
+
+applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
+
+// declare where to find the dependencies of your project
+repositories {
+mavenCentral()
+maven { url 
"https://repository.apache.org/content/repositories/snapshots/; }
+}
+
+// NOTE: We cannot use "compileOnly" or "shadow" configurations since then 
we could not run code
+// in the IDE or with "gradle run". We also cannot exclude transitive 
dependencies from the
+// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
+// -> Explicitly define the // libraries we want to be included in the 
"myShadowJar" configuration!
+configurations {
+myShadowJar // dependencies which go into the shadowJar
+
+// always exclude these (also from transitive dependencies) since they 
are provided by Flink
+myShadowJar.exclude group: 'org.apache.flink', module: 'force-shading'
+myShadowJar.exclude group: 'com.google.code.findbugs', module: 'jsr305'
+myShadowJar.exclude group: 'org.slf4j'
+myShadowJar.exclude group: 'log4j'
+}
+
+// declare the dependencies for your production and test code
+dependencies {
+compile "org.apache.flink:flink-java:${flinkVersion}"
+compile 
"org.apache.flink:flink-streaming-java_${scalaBinaryVersion}:${flinkVersion}"
+
+//myShadowJar 
"org.apache.flink:flink-connector-kafka-0.11_${scalaBinaryVersion}:${flinkVersion}"
--- End diff --

What is this line good for? If it should be an example add a line comment.


> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: 

[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-06-12 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16509553#comment-16509553
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user twalthr commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r194709349
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -108,16 +118,201 @@ In Eclipse, choose
 box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.3'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '1.6-SNAPSHOT'
+scalaBinaryVersion = '2.11'
+slf4jVersion = '1.7.7'
+log4jVersion = '1.2.17'
+}
+
+
+sourceCompatibility = javaVersion
+targetCompatibility = javaVersion
+tasks.withType(JavaCompile) {
+   options.encoding = 'UTF-8'
+}
+
+applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
+
+// declare where to find the dependencies of your project
+repositories {
+mavenCentral()
+maven { url 
"https://repository.apache.org/content/repositories/snapshots/; }
+}
+
+// NOTE: We cannot use "compileOnly" or "shadow" configurations since then 
we could not run code
+// in the IDE or with "gradle run". We also cannot exclude transitive 
dependencies from the
+// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
+// -> Explicitly define the // libraries we want to be included in the 
"myShadowJar" configuration!
+configurations {
+myShadowJar // dependencies which go into the shadowJar
+
+// always exclude these (also from transitive dependencies) since they 
are provided by Flink
+myShadowJar.exclude group: 'org.apache.flink', module: 'force-shading'
+myShadowJar.exclude group: 'com.google.code.findbugs', module: 'jsr305'
+myShadowJar.exclude group: 'org.slf4j'
+myShadowJar.exclude group: 'log4j'
+}
+
+// declare the dependencies for your production and test code
+dependencies {
--- End diff --

Shall we move the sections for which a user cares (Flink version and 
dependencies) to the beginning? 


> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: Improvement
>  Components: Project Website, Quickstarts
>Reporter: Nico Kruber
>Assignee: Nico Kruber
>Priority: Critical
>
> Having a proper project template helps a lot in getting dependencies right. 
> 

[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-06-12 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16509555#comment-16509555
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user twalthr commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r194708957
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -108,16 +118,201 @@ In Eclipse, choose
 box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.3'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '1.6-SNAPSHOT'
--- End diff --

Add doc variables here and the following line.


> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: Improvement
>  Components: Project Website, Quickstarts
>Reporter: Nico Kruber
>Assignee: Nico Kruber
>Priority: Critical
>
> Having a proper project template helps a lot in getting dependencies right. 
> For example, setting the core dependencies to "provided", the connector / 
> library dependencies to "compile", etc.
> The Maven quickstarts are in good shape by now, but there is none for Gradle 
> and Gradle users to get this wrong quite often.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-06-12 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16509551#comment-16509551
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user twalthr commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r194708294
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -108,16 +118,201 @@ In Eclipse, choose
 box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.3'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '1.6-SNAPSHOT'
+scalaBinaryVersion = '2.11'
+slf4jVersion = '1.7.7'
+log4jVersion = '1.2.17'
+}
+
+
+sourceCompatibility = javaVersion
+targetCompatibility = javaVersion
+tasks.withType(JavaCompile) {
+   options.encoding = 'UTF-8'
+}
+
+applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
+
+// declare where to find the dependencies of your project
+repositories {
+mavenCentral()
+maven { url 
"https://repository.apache.org/content/repositories/snapshots/; }
+}
+
+// NOTE: We cannot use "compileOnly" or "shadow" configurations since then 
we could not run code
+// in the IDE or with "gradle run". We also cannot exclude transitive 
dependencies from the
+// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
+// -> Explicitly define the // libraries we want to be included in the 
"myShadowJar" configuration!
+configurations {
+myShadowJar // dependencies which go into the shadowJar
+
+// always exclude these (also from transitive dependencies) since they 
are provided by Flink
+myShadowJar.exclude group: 'org.apache.flink', module: 'force-shading'
+myShadowJar.exclude group: 'com.google.code.findbugs', module: 'jsr305'
+myShadowJar.exclude group: 'org.slf4j'
+myShadowJar.exclude group: 'log4j'
+}
+
+// declare the dependencies for your production and test code
+dependencies {
+compile "org.apache.flink:flink-java:${flinkVersion}"
+compile 
"org.apache.flink:flink-streaming-java_${scalaBinaryVersion}:${flinkVersion}"
+
+//myShadowJar 
"org.apache.flink:flink-connector-kafka-0.11_${scalaBinaryVersion}:${flinkVersion}"
+
+compile "log4j:log4j:${log4jVersion}"
+compile "org.slf4j:slf4j-log4j12:${slf4jVersion}"
+
+testCompile "junit:junit:4.12"
+}
+
+// make compileOnly dependencies available for tests:
+sourceSets {
+main.runtimeClasspath += configurations.myShadowJar
+

[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-06-12 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16509550#comment-16509550
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user twalthr commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r194711334
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -108,16 +118,201 @@ In Eclipse, choose
 box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.3'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '1.6-SNAPSHOT'
+scalaBinaryVersion = '2.11'
+slf4jVersion = '1.7.7'
+log4jVersion = '1.2.17'
+}
+
+
+sourceCompatibility = javaVersion
+targetCompatibility = javaVersion
+tasks.withType(JavaCompile) {
+   options.encoding = 'UTF-8'
+}
+
+applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
+
+// declare where to find the dependencies of your project
+repositories {
+mavenCentral()
+maven { url 
"https://repository.apache.org/content/repositories/snapshots/; }
+}
+
+// NOTE: We cannot use "compileOnly" or "shadow" configurations since then 
we could not run code
+// in the IDE or with "gradle run". We also cannot exclude transitive 
dependencies from the
+// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
+// -> Explicitly define the // libraries we want to be included in the 
"myShadowJar" configuration!
+configurations {
+myShadowJar // dependencies which go into the shadowJar
+
+// always exclude these (also from transitive dependencies) since they 
are provided by Flink
+myShadowJar.exclude group: 'org.apache.flink', module: 'force-shading'
+myShadowJar.exclude group: 'com.google.code.findbugs', module: 'jsr305'
+myShadowJar.exclude group: 'org.slf4j'
+myShadowJar.exclude group: 'log4j'
+}
+
+// declare the dependencies for your production and test code
+dependencies {
+compile "org.apache.flink:flink-java:${flinkVersion}"
+compile 
"org.apache.flink:flink-streaming-java_${scalaBinaryVersion}:${flinkVersion}"
+
+//myShadowJar 
"org.apache.flink:flink-connector-kafka-0.11_${scalaBinaryVersion}:${flinkVersion}"
+
+compile "log4j:log4j:${log4jVersion}"
+compile "org.slf4j:slf4j-log4j12:${slf4jVersion}"
+
+testCompile "junit:junit:4.12"
--- End diff --

This should not be here by default.


> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> 

[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-06-12 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16509552#comment-16509552
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user twalthr commented on a diff in the pull request:

https://github.com/apache/flink/pull/5900#discussion_r194707286
  
--- Diff: docs/quickstart/java_api_quickstart.md ---
@@ -108,16 +118,201 @@ In Eclipse, choose
 box: `-Xmx800m`.
 In IntelliJ IDEA recommended way to change JVM options is from the `Help | 
Edit Custom VM Options` menu. See [this 
article](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
 for details. 
 
-## Build Project
+### Build Project
 
 If you want to __build/package your project__, go to your project 
directory and
 run the '`mvn clean package`' command.
 You will __find a JAR file__ that contains your application, plus 
connectors and libraries
 that you may have added as dependencies to the application: 
`target/-.jar`.
 
 __Note:__ If you use a different class than *StreamingJob* as the 
application's main class / entry point,
-we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, the Flink
-can run time application from the JAR file without additionally specifying 
the main class.
+we recommend you change the `mainClass` setting in the `pom.xml` file 
accordingly. That way, Flink
+can run the application from the JAR file without additionally specifying 
the main class.
+
+## Gradle
+
+### Requirements
+
+The only requirements are working __Gradle 3.x__ (or higher) and __Java 
8.x__ installations.
+
+### Create Project
+
+Use one of the following commands to __create a project__:
+
+
+Gradle example
+Run the 
quickstart script
+
+
+
+
+
+build.gradle
+settings.gradle
+
+
+
+{% highlight gradle %}
+buildscript {
+repositories {
+jcenter() // this applies only to the Gradle 'Shadow' plugin
+}
+dependencies {
+classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3'
+}
+}
+
+plugins {
+id 'java'
+id 'application'
+// shadow plugin to produce fat JARs
+id 'com.github.johnrengelman.shadow' version '2.0.3'
+}
+
+
+// artifact properties
+group = 'org.myorg.quickstart'
+version = '0.1-SNAPSHOT'
+mainClassName = 'org.myorg.quickstart.StreamingJob'
+description = """Flink Quickstart Job"""
+
+ext {
+javaVersion = '1.8'
+flinkVersion = '1.6-SNAPSHOT'
+scalaBinaryVersion = '2.11'
+slf4jVersion = '1.7.7'
+log4jVersion = '1.2.17'
+}
+
+
+sourceCompatibility = javaVersion
+targetCompatibility = javaVersion
+tasks.withType(JavaCompile) {
+   options.encoding = 'UTF-8'
+}
+
+applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
+
+// declare where to find the dependencies of your project
+repositories {
+mavenCentral()
+maven { url 
"https://repository.apache.org/content/repositories/snapshots/; }
+}
+
+// NOTE: We cannot use "compileOnly" or "shadow" configurations since then 
we could not run code
+// in the IDE or with "gradle run". We also cannot exclude transitive 
dependencies from the
+// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
+// -> Explicitly define the // libraries we want to be included in the 
"myShadowJar" configuration!
+configurations {
+myShadowJar // dependencies which go into the shadowJar
--- End diff --

Call this flinkShadowJar? Or some more meaningful name.


> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: Improvement
>  Components: Project Website, Quickstarts
>Reporter: Nico Kruber
>Assignee: Nico Kruber
>Priority: Critical
>
> Having a proper project template helps a lot in getting dependencies right. 
> For example, setting the core dependencies to "provided", the connector / 
> library dependencies to "compile", etc.
> The Maven quickstarts are in good shape by now, but there is none for Gradle 
> and Gradle users to get this wrong quite often.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-04-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16458986#comment-16458986
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

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


> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: Improvement
>  Components: Project Website, Quickstarts
>Reporter: Nico Kruber
>Assignee: Nico Kruber
>Priority: Critical
>
> Having a proper project template helps a lot in getting dependencies right. 
> For example, setting the core dependencies to "provided", the connector / 
> library dependencies to "compile", etc.
> The Maven quickstarts are in good shape by now, but there is none for Gradle 
> and Gradle users to get this wrong quite often.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-04-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16458960#comment-16458960
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

Github user StephanEwen commented on the issue:

https://github.com/apache/flink/pull/5900
  
Nice addition!

A few things I would like to double check on the quickstart configuration 
(I am not fluent enough Gradle):

  - We do not need to hide/shade any dependencies in the user code. In 
Maven, we use the shade plugin, but only to build an uber jar, not to actually 
relocate dependencies. Is that the same in the Gradle quickstart?

  - The Flink core dependencies need to be in a scope equivalent to 
"provided", so they do not end up in the uber jar. Can we do something similar 
in Gradle? This has been a frequent source of unnecessarily bloated application 
jars.

  - The Maven quickstart template uses a trick to make sure that the 
provided dependencies are still in the classpath when we run the program in the 
IDE: A profile that activates in IDEA (by a property variable) and alters the 
scope from *provided* to *compile*. Not sure if that is strictly necessary, but 
may be helpful.


> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: Improvement
>  Components: Project Website, Quickstarts
>Reporter: Nico Kruber
>Assignee: Nico Kruber
>Priority: Critical
>
> Having a proper project template helps a lot in getting dependencies right. 
> For example, setting the core dependencies to "provided", the connector / 
> library dependencies to "compile", etc.
> The Maven quickstarts are in good shape by now, but there is none for Gradle 
> and Gradle users to get this wrong quite often.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-04-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16448452#comment-16448452
 ] 

ASF GitHub Bot commented on FLINK-9222:
---

GitHub user NicoK opened a pull request:

https://github.com/apache/flink/pull/5900

[FLINK-9222][docs] add documentation for setting up Gradle projects

## What is the purpose of the change

Together with https://github.com/apache/flink-web/pull/105, this will add a 
project template for setting up Flink jobs via Gradle.

## Brief change log

- adapt documentation to cover Gradle for Java:
  - add project file templates to the docs
  - link the new quickstart
  - adapt the description


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/NicoK/flink flink-9222

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/flink/pull/5900.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #5900


commit 2d5bdb141560c74393841e02b48c75024193f8eb
Author: Nico Kruber 
Date:   2018-04-23T16:58:15Z

[hotfix][docs] fix some typos

commit e5a3e52c660898106e615f0fbf99b2f8091e469c
Author: Nico Kruber 
Date:   2018-04-23T16:58:28Z

[FLINK-9222][docs] add documentation for setting up Gradle projects




> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: Improvement
>  Components: Quickstarts
>Reporter: Nico Kruber
>Assignee: Nico Kruber
>Priority: Critical
>
> Having a proper project template helps a lot in getting dependencies right. 
> For example, setting the core dependencies to "provided", the connector / 
> library dependencies to "compile", etc.
> The Maven quickstarts are in good shape by now, but there is none for Gradle 
> and Gradle users to get this wrong quite often.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9222) Add a Gradle Quickstart

2018-04-19 Thread Nico Kruber (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16444291#comment-16444291
 ] 

Nico Kruber commented on FLINK-9222:


actually, what is wrong with the existing SBT quickstarts at 
https://ci.apache.org/projects/flink/flink-docs-master/quickstart/scala_api_quickstart.html#sbt
 ?

> Add a Gradle Quickstart
> ---
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
>  Issue Type: Improvement
>  Components: Quickstarts
>Reporter: Nico Kruber
>Assignee: Nico Kruber
>Priority: Critical
>
> Having a proper project template helps a lot in getting dependencies right. 
> For example, setting the core dependencies to "provided", the connector / 
> library dependencies to "compile", etc.
> The Maven quickstarts are in good shape by now, but there is none for Gradle 
> and Gradle users to get this wrong quite often.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)