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

Fix quarkus run/dev for jbang projects #34102

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

maxandersen
Copy link
Member

wanted to implement quarkus run and quarkus dev to work for jbang.

This pr has a first cut on that but then I've found somewhere in latest 2.x or early 3.x jbang support was broken for jbang dev mode launching.

Opening this in draft mode to share and hear if @aloubyansky or @stuartwdouglas has ideas why we are now no longer able to handle the .jar when running in devmode. The code in IDELauncher forces .jar to be treated as a classes directory which it is obviously not.

@quarkus-bot
Copy link

quarkus-bot bot commented Jun 16, 2023

Thanks for your pull request!

The title of your pull request does not follow our editorial rules. Could you have a look?

  • title should preferably start with an uppercase character (if it makes sense!)

This message is automatically generated by a bot.

@quarkus-bot quarkus-bot bot added area/cli Related to quarkus cli (not maven/gradle/etc.) area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/jbang Issues related to when using jbang.dev with Quarkus labels Jun 16, 2023
@maxandersen maxandersen changed the title fix quarkus run/dev for jbang projects Fix quarkus run/dev for jbang projects Jun 16, 2023
maxandersen and others added 4 commits June 16, 2023 17:36
Downloads latest jbang, launch jbang with quarkus app to assert devmode
is enabled and uses zt-exec for ease of use to process output.
@maxandersen
Copy link
Member Author

the difference between something working or not is wether it has a main method or not.

works:

//usr/bin/env jbang "$0" "$@" ; exit $?
//JAVA 17
//JAVAC_OPTIONS -parameters
//DEPS io.quarkus:quarkus-bom:999-SNAPSHOT@pom
//DEPS io.quarkus:quarkus-resteasy

import io.quarkus.runtime.Quarkus;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;

@Path("/hello-resteasy")
@ApplicationScoped
public class main {

    @GET
    public String sayHello() {
        return "Hello RESTEasy";
    }

    //public static void main(String[] args) {
    //    Quarkus.run(args);
    //}
}

fails:

//usr/bin/env jbang "$0" "$@" ; exit $?
//JAVA 17
//JAVAC_OPTIONS -parameters
//DEPS io.quarkus:quarkus-bom:999-SNAPSHOT@pom
//DEPS io.quarkus:quarkus-resteasy

import io.quarkus.runtime.Quarkus;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;

@Path("/hello-resteasy")
@ApplicationScoped
public class main {

    @GET
    public String sayHello() {
        return "Hello RESTEasy";
    }

    public static void main(String[] args) {
        Quarkus.run(args);
    }
}

@quarkus-bot quarkus-bot bot added the area/platform Issues related to definition and interaction with Quarkus Platform label Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/jbang Issues related to when using jbang.dev with Quarkus area/platform Issues related to definition and interaction with Quarkus Platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants