🔨 Built using Micronaut framework and GraalVM executable. CLI built using Picocli library.🔨
Description | CLI Comamnd |
---|---|
Install GraalVM using sdkman | sdk install java 20.1.0.r11-grl |
Use GraalVm | sdk use java 20.1.0.r11-grl |
Install Native Image executable using GraalVM Updater | gu install native-image |
List GraalVM CLI | gu list |
Use SDKMan for easy switching between Java Version (among others)
- Install GraalVM-specific Java 11 JDK.
sdk install java 20.1.0.r11-grl
- Use GraalVm's Java 11
sdk use java 20.1.0.r11-grl
- Install Native Image for native executable JARs
gu install native-image
- [Check] List images
gu list
./gradlew --no-daemon assemble
- This builds Shadow JAR of the project.
-
java -jar build/libs/stackoverflow-cli-0.1-all.jar
-
java -jar build/libs/stackoverflow-cli-0.1-all.jar search
-
java -jar build/libs/stackoverflow-cli-0.1-all.jar search -q "merge maps" -t java
-
java -jar build/libs/stackoverflow-cli-0.1-all.jar search -q "merge maps" -t java --verbose
native-image --no-server -cp build/libs/stackoverflow-cli-0.1-all.jar
- Builds the JAR to binary executable, which doesn't require java for executing.
Use command to run the native-executable: ./stackoverflow-cli search -q "merge maps" -t java --verbose
API Link: https://api.stackexchange.com/docs/authentication
Register API here: https://stackapps.com/apps/oauth/register
Running only auth
package
./gradlew --no-daemon run --args="auth"
Credentials are stored in: ~/.stackoverflow-cli/credentials.properties
- Graceful shutdown of Netty Event Loop (Micronaut's HTTP client) takes 2 seconds. micronaut-projects/micronaut-core#3582