All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ng-cli.0.119.0.source-code.init-qcli.qute Maven / Gradle / Ivy

There is a newer version: 0.121.0
Show newest version
///usr/bin/env jbang "$0" "$@" ; exit $?
//JAVA 17+
// Update the Quarkus version to what you want here or run jbang with
// `-Dquarkus.version=` to override it.
//DEPS io.quarkus:quarkus-bom:$\{quarkus.version:3.7.2\}@pom
//DEPS io.quarkus:quarkus-picocli
{#for dep in dependencies.orEmpty}
//DEPS {dep}
{/for}
//Q:CONFIG quarkus.banner.enabled=false
//Q:CONFIG quarkus.log.level=WARN

import picocli.CommandLine;

import jakarta.enterprise.context.Dependent;
import jakarta.inject.Inject;
import io.quarkus.runtime.annotations.QuarkusMain;
import io.quarkus.runtime.QuarkusApplication;
import io.quarkus.runtime.Quarkus;

@CommandLine.Command
public class {baseName} implements Runnable {

    @CommandLine.Parameters(index = "0", description = "The greeting to print", defaultValue = "World!")
    String name;

    @Inject
    CommandLine.IFactory factory;

    private final GreetingService greetingService;

    public {baseName}(GreetingService greetingService) {
        this.greetingService = greetingService;
    }

    @Override
    public void run() {
        greetingService.sayHello(name);
    }

}

@Dependent
class GreetingService {
    void sayHello(String name) {
        System.out.println("Hello " + name + "!");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy