Groovy & Gradle: JVM Automation and Build Engineering · Lección

Instalación y CLI de Gradle

Instale Gradle, comprenda su interfaz de línea de comandos y ejecute comandos básicos de compilación.

Lección 1 de 411 pasos

Instalación y CLI de Gradle es una lección gratuita de Groovy & Gradle: JVM Automation and Build Engineering en CoddyKit. Esta es la lección 1 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de Groovy & Gradle: JVM Automation and Build Engineering, y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de Groovy & Gradle: JVM Automation and Build Engineering incluye 4 lecciones en total.

Partes de esta lección aún no han sido traducidas y se muestran en inglés.

Meet the Gradle CLI

The Gradle Command Line Interface (CLI) is your main tool for interacting with Gradle. It's how you tell Gradle what to do, like building your project or running tests.

Understanding the CLI is crucial for automating your build processes and managing your projects effectively.

Java is Required!

Before installing Gradle, you need to have the Java Development Kit (JDK) installed on your system. Gradle runs on the Java Virtual Machine (JVM), just like Java applications.

  • Ensure you have JDK 8 or higher.
  • You can check your Java version with: java -version

How to Install Gradle

There are several ways to install Gradle. For beginners, using a version manager like SDKMAN! is highly recommended. It simplifies managing multiple SDK versions.

  • SDKMAN!: Easy and flexible.
  • Manual Download: More setup required.
  • Package Managers: Homebrew (macOS), Chocolatey (Windows).

Install Gradle via SDKMAN!

SDKMAN! (Software Development Kit Manager) makes installing Gradle super easy. If you don't have SDKMAN!, install it first by following instructions on sdkman.io.

Once SDKMAN! is ready, open your terminal and run:

sdk install gradle

Check Your Gradle Version

After installation, it's a good practice to verify that Gradle is correctly installed and accessible from your terminal. This command shows the Gradle version and other environment details.

Run this in your terminal:

gradle -v

Discovering Gradle Tasks

The most common command to start with is gradle tasks. This command lists all available tasks for the current project. If you're not in a Gradle project, it shows generic tasks.

Let's try it:

gradle tasks

What `gradle tasks` Shows

When you run gradle tasks, you'll see categories like "Build tasks", "Verification tasks", etc., each with a list of tasks and their descriptions.

  • Tasks: Are the actual actions Gradle performs (e.g., build, clean, test).
  • Description: Explains what each task does.

This output helps you understand what operations your project supports.

Need Help? Use `gradle help`

Gradle has a built-in help system. If you want to know more about a specific task, you can use the help task with the --task option.

For example, to learn about the build task:

gradle help --task build

Intro to Gradle Wrapper (gradlew)

Many Gradle projects include a Gradle Wrapper (gradlew or gradlew.bat). This script ensures everyone uses the same Gradle version for a project, even if they don't have Gradle installed globally.

You'll often run commands like ./gradlew build instead of gradle build.

Test Your CLI Knowledge

Let's check your understanding of basic Gradle commands!

Recap: Gradle CLI Essentials

Great job! In this lesson, you learned how to:

  • Understand the role of the Gradle CLI.
  • Install Gradle using SDKMAN!.
  • Verify your installation with gradle -v.
  • List available tasks using gradle tasks.
  • Get help for specific tasks with gradle help --task <taskName>.
  • Briefly grasp the concept of the Gradle Wrapper.

Next, we'll dive into setting up a basic Gradle project!

Gratis para empezar

Aprende Groovy con un tutor de IA — gratis

Escribe y ejecuta código real en tu navegador, obtén ayuda instantánea de un tutor de IA disponible 24/7 y continúa donde lo dejaste en la web o en la aplicación.

Cursos
12
Lecciones
48

Preguntas frecuentes

¿La lección «Instalación y CLI de Gradle» es gratis?

Sí — el texto completo de «Instalación y CLI de Gradle» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de Groovy & Gradle: JVM Automation and Build Engineering, actualiza a CoddyKit PRO. El curso de Groovy & Gradle: JVM Automation and Build Engineering incluye 4 lecciones en total.

¿Qué aprenderé en «Instalación y CLI de Gradle»?

Instale Gradle, comprenda su interfaz de línea de comandos y ejecute comandos básicos de compilación. Practicas Groovy & Gradle: JVM Automation and Build Engineering con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.

¿Necesito experiencia previa para empezar Groovy & Gradle: JVM Automation and Build Engineering?

No se requiere experiencia previa. Groovy & Gradle: JVM Automation and Build Engineering en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 1 de 4.

¿Cuánto tiempo toma la lección «Instalación y CLI de Gradle»?

La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.

¿Puedo escribir y ejecutar código en esta lección de Groovy & Gradle: JVM Automation and Build Engineering?

Sí. Cada lección de Groovy & Gradle: JVM Automation and Build Engineering incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.

Todas las lecciones de este curso

  1. Instalación y CLI de Gradle
  2. Estructura de proyectos de Gradle
  3. Tareas y ciclo de vida de compilación
  4. Compilaciones multiproyecto y archivo de configuración
← Volver a Groovy & Gradle: JVM Automation and Build Engineering