This is incorrect. Your working directory should be the project directory (or you need to specify it manually as a command line argument, but this is atypical), not the bin directory of the Gradle distribution. The Gradle binary will be found via the PATH, from any working directory, using just gradle (no ./).
Right james.Now, I have created a project & after running “gradle init” i ran “./gradlew clean shadowJar”
Now it is giving me Error:
Task ‘shadowJar’ not found in root project ‘projects’
gradle tasks o/p:
:tasks
All tasks runnable from root project
Build tasks
assemble - Assembles the outputs of this project.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
classes - Assembles main classes.
clean - Deletes the build directory.
jar - Assembles a jar archive containing the main classes.
testClasses - Assembles test classes.
Build Setup tasks
init - Initializes a new Gradle build. [incubating]
wrapper - Generates Gradle wrapper files. [incubating]
Documentation tasks
groovydoc - Generates Groovydoc API documentation for the main source code.
javadoc - Generates Javadoc API documentation for the main source code.
Help tasks
buildEnvironment - Displays all buildscript dependencies declared in root project ‘projects’.
components - Displays the components produced by root project ‘projects’. [incubating]
dependencies - Displays all dependencies declared in root project ‘projects’.
dependencyInsight - Displays the insight into a specific dependency in root project ‘projects’.
help - Displays a help message.
model - Displays the configuration model of root project ‘projects’. [incubating]
projects - Displays the sub-projects of root project ‘projects’.
properties - Displays the properties of root project ‘projects’.
tasks - Displays the tasks runnable from root project ‘projects’.
Verification tasks
check - Runs all checks.
test - Runs the unit tests.
Rules
Pattern: clean: Cleans the output files of a task.
Pattern: build: Assembles the artifacts of a configuration.
Pattern: upload: Assembles and uploads the artifacts belonging to a configuration.
To see all tasks and more detail, run gradle tasks --all
To see more detail about a task, run gradle help --task
What went wrong:
A problem occurred evaluating root project ‘airpal’.
Cannot cast object ‘[configuration ‘:provided’]’ with class ‘java.util.ArrayList’ to class ‘org.gradle.api.file.FileCollection’ due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.gradle.api.file.FileCollection(org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated)
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.