Replies: 3 comments 5 replies
-
I haven't tried looking into this deeply yet, but could it be that the JAR that Jitpack builds isn't the same as the one that you build locally? Can you try running the Jitpack JAR manually, using |
Beta Was this translation helpful? Give feedback.
-
You need to publish the Uber jar to have quarkus app working. |
Beta Was this translation helpful? Give feedback.
-
An other experiment I did was to follow the Scripting with Quarkus guide but replace the ///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS io.quarkus.platform:quarkus-bom:3.4.1@pom
//DEPS io.quarkus:quarkus-picocli
import static java.lang.System.*;
import io.quarkus.runtime.Quarkus;
import picocli.CommandLine;
import picocli.CommandLine.Command;
import picocli.CommandLine.Parameters;
@Command(name = "greeting", mixinStandardHelpOptions = true)
public class quarkusapp implements Runnable {
public static void main(String[] args) {
Quarkus.run(args);
}
@Parameters(paramLabel = "<name>", defaultValue = "picocli",
description = "Your name.")
String name;
@Override
public void run() {
System.out.printf("Hello %s, go go commando!\n", name);
}
} This doesn't work either. Maybe the behavior is different between the 2 extensions. |
Beta Was this translation helpful? Give feedback.
-
I have a quarkus picocli application.
The discussion is about running just the published
jar
not theuber-jar
variant.Is there a way to run this quarkus CLI application directly with Jbang?
Obviously I am missing something...
Setup:
Link to generate the app: code.quarkus.io
This is pushed to this repo:
https://github.com/jmini/quarkus-picocli-experiment
It can be built with Jitpack (build log), so it is available on a maven repository:
Maven coordinates
using:
as dependency:
Gradle coordinates
using:
Usage of JitPack is easier for this discussion, but I could imagine working with a regular maven repo (inside our company repo or maven central)
Experiments:
All the Run files can be found here in this repo quarkus-jbang-run
Test 1
I have tried:
Output
Somehow expected when you look at the content of quarkus-picocli-experiment-main-9fc985be83-1.jar (it is not a standalone jar)
Test 2
Test 3
The Stacktrace when using
--verbose
for Run2 and Run3 looks similar and seems to be related to the JitPack repo not being declared to the postBuild step. (maybe a first issue?)Stacktrace for Run2 and Run3
Test 4
With an explicit declaration of the jitpack repo:
Output:
Test 5
output:
At the end the
Run5
is the closest to what I would like to get, but obviously the code defined inquarkus-picocli-experiment-main-9fc985be83-1.jar
is not working.By comparison, When in my local clone of the quarkus-picocli-experiment repo I run:
I get the expected
Hello picocli, go go commando!
in the log:Which I would like to get also when running from JBang.
Beta Was this translation helpful? Give feedback.
All reactions