Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quickstart guide gradle build doesn't work #86

Open
vshwnth2 opened this issue Nov 10, 2017 · 7 comments
Open

quickstart guide gradle build doesn't work #86

vshwnth2 opened this issue Nov 10, 2017 · 7 comments
Labels
build Build failures and problems

Comments

@vshwnth2
Copy link
Contributor

vshwnth2 commented Nov 10, 2017

Trying to follow https://github.com/linkedin/rest.li/wiki/Quickstart:-A-Tutorial-Introduction-to-Rest.li

On the first gradle build command inside /api folder, i get the following error:

Task :api:generateDataTemplate FAILED
[main] INFO com.linkedin.pegasus.generator.PegasusDataTemplateGenerator - Generating 1 files
Exception in thread "main" java.io.IOException: /Users/maheshvishwanath/sante-restli/api/src/mainGeneratedDataTemplate/java: non-existent directory
at com.sun.codemodel.writer.FileCodeWriter.(FileCodeWriter.java:73)
at com.linkedin.pegasus.generator.PegasusDataTemplateGenerator.run(PegasusDataTemplateGenerator.java:152)
at com.linkedin.pegasus.generator.PegasusDataTemplateGenerator.main(PegasusDataTemplateGenerator.java:105)

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':api:generateDataTemplate'.

Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

If it helps, these are the versions I have installed locally:
gradle --version


Gradle 4.3.1

Build time: 2017-11-08 08:59:45 UTC
Revision: e4f4804807ef7c2829da51877861ff06e07e006d

Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM: 1.8.0_121 (Oracle Corporation 25.121-b13)
OS: Mac OS X 10.12.4 x86_64

@vshwnth2
Copy link
Contributor Author

stacktrace:

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':api:generateDataTemplate'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
    at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
    at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    Caused by: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
    at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:382)
    at org.gradle.process.internal.DefaultJavaExecAction.execute(DefaultJavaExecAction.java:31)
    at org.gradle.api.tasks.JavaExec.exec(JavaExec.java:74)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:784)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:751)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
    ... 29 more

@DongQuYiPiLang
Copy link

should be the gradle version issue, if you use gradle 4.0, it will be fine, good luck!

@evanw555
Copy link
Contributor

evanw555 commented Aug 3, 2019

@vshwnth2 This is quite a delayed follow-up, but this was resolved, yeah?

@evanw555 evanw555 added the build Build failures and problems label Aug 3, 2019
@venkyvb
Copy link

venkyvb commented Apr 24, 2020

The quick-start seems to be broken again. When I go the /api folder and do a gradle build I see the following error:

FAILURE: Build failed with an exception.

* Where:
Build file '/rest.li-master/examples/quickstart/build.gradle' line: 12

* What went wrong:
A problem occurred evaluating root project 'quickstart'.
> Cannot add task 'wrapper' as a task with that name already exists.

* 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 436ms

When I change the following in the /rest.li-master/examples/quickstart/build.gradle

task wrapper(type: Wrapper) {
  gradleVersion = '4.6'
}

to

wrapper {
  gradleVersion = '4.6'
}

and then try gradle build in the /api folder I see the following error:

> Task :api:changedFilesReport FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':api:changedFilesReport'.
> You must declare outputs or use `TaskOutputs.upToDateWhen()` when using the incremental task API

* 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

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.0.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 637ms
6 actionable tasks: 1 executed, 5 up-to-date

any ideas as to what could be going wrong?

@evanw555
Copy link
Contributor

evanw555 commented Apr 27, 2020

@venkyvb Yeah, my guess is that this is something we forgot to clean up when upgrading to Gradle 5. See how we removed the wrapper task for the root build script in #242. I'm inferring that the guy who did the work didn't try building these sample projects (people often forget they're there). Could you try removing the wrapper task definition altogether? If it works, feel free to open a PR to fix this.

@liz2020
Copy link

liz2020 commented May 20, 2021

@evanw555 I tried removing the wrapper task (line 12 - 14 in build.gradle) and it builds successfully. So, your suggestion works!

@viju4u
Copy link

viju4u commented Jun 13, 2022

Task :api:generateDataTemplate FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Some problems were found with the configuration of task ':api:generateDataTemplate' (type 'GenerateDataTemplateTask').

  • 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.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 4s
1 actionable task: 1 executed

I am facing this issue when i tried to build in api gradle file
//Content of build file in api folder
api/build.gradle
apply plugin: 'pegasus'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build failures and problems
Projects
None yet
Development

No branches or pull requests

6 participants