You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Marcus Truscello (Jira)" <ji...@apache.org> on 2020/08/07 18:39:00 UTC
[jira] [Created] (BEAM-10661) Java quickstart using Gradle doesn't
work
Marcus Truscello created BEAM-10661:
---------------------------------------
Summary: Java quickstart using Gradle doesn't work
Key: BEAM-10661
URL: https://issues.apache.org/jira/browse/BEAM-10661
Project: Beam
Issue Type: Bug
Components: website
Reporter: Marcus Truscello
As written, the Java quickstart using Gradle doesn't work. The issue is that the {{execute}} task created in step 2 makes it so that the {{exec.args}} define is required for every task (including build!), otherwise a NullPointerException is thrown.
Example output:
{code:java}
~/word-count-beam$ gradle build
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/username/word-count-beam/build.gradle' line: 56
* What went wrong:
A problem occurred evaluating root project 'word-count-beam'.
> java.lang.NullPointerException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 582ms
{code}
Where line 56 of my build.gradle file is the split command in the execute task:
{code:java}
52 task execute (type:JavaExec) {
53 main = System.getProperty("mainClass")
54 classpath = sourceSets.main.runtimeClasspath
55 systemProperties System.getProperties()
56 args System.getProperty("exec.args").split()
57 }
{code}
Running with an empty exec.args fixes the issue:
{code:java}
~/word-count-beam$ gradle build -Dexec.args=""
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 782ms
4 actionable tasks: 4 up-to-date
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)