exp 22222222

cd ~

mkdir HelloGradleGroovy

cd HelloGradleGroovy

gradle init --type java-application --dsl groovy --overwrite

cd ~

tree

gedit app/build.gradle

plugins {

    // Apply the Java plugin for compiling Java code

    id 'java'

    // Apply the application plugin to add support for building an application

    id 'application'

}


group = 'org.example'

version = '1.0'


repositories {

    // Use Maven Central for resolving dependencies.

    mavenCentral()

}


dependencies {

    // Define your dependencies. Use JUnit Jupiter (JUnit 5) for testing.

    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'

    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'

    // If using parameterized tests

    testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.0'

}


application {

    // Define the main class for the application.

    mainClass = 'org.example.App'

}


// A custom task example: printing a greeting

task hello {

    doLast {

        println 'Hello, Gradle!'

    }

}gradle build,gradle run.gradle hello

Comments

Popular posts from this blog