Catalogue for JBang Artifacts
Перейти к файлу
Max Rydahl Andersen a8fc96952e
update to java 17 based minecraft
according to https://twitter.com/brunoborges/status/1465806238428512260?s=20 Java 17 is the new thing :)
2021-11-30 23:38:47 +01:00
.gitignore Initial commit 2021-11-24 19:06:41 +00:00
CODE_OF_CONDUCT.md CODE_OF_CONDUCT.md committed 2021-11-24 11:06:45 -08:00
LICENSE LICENSE committed 2021-11-24 11:06:46 -08:00
README.md Update README.md 2021-11-25 14:27:22 -08:00
SECURITY.md SECURITY.md committed 2021-11-24 11:06:47 -08:00
SUPPORT.md SUPPORT.md committed 2021-11-24 11:06:48 -08:00
jbang-catalog.json update to java 17 based minecraft 2021-11-30 23:38:47 +01:00

README.md

Microsoft JBang Catalog

JBang is an open source project that allows developers to script programs in Java, and optionally rely on dependencies hosted on Maven Central. Learn more about JBang from this InfoQ article.

This repository hosts the catalog of Microsoft projects with support for JBang.

Before continuing, install JBang.

To list the latest available artifacts in the Microsoft JBang's catalog, run the following:

$ jbang catalog list microsoft

Microsoft JBang Projects

Currently there are three projects:

  • Minecraft: Java Edition Server
  • Azure Application Insights Agent
  • Playwright for Java

Minecraft: Java Edition Server

To start a Minecraft Java Server using JBang, follow these steps:

  1. Create a folder minecraft-server and get into it on your terminal.
  2. Read and accept the Minecraft EULA. To accept the EULA, create a local file named eula.txt with content eula=true inside.
  3. Run the server:
~/minecraft-server $ echo "eula=true" > eula.txt
~/minecraft-server $ jbang minecraft-server@microsoft

Once you start the server, a server.properties file will be created for further customizations. Learn more.

If you want to run this on a headless server, add nogui argument.

~/minecraft-server $ jbang minecraft-server@microsoft nogui

Playwright

Playwright for JBang is a wrapper for the Playwright Java CLI.

Here's an example of how to generate a sample Playwright script. A browser window will start and the navigation flow will get recorded in the Example.java file.

$ jbang playwright@microsoft codegen -o Example.java

Now run the script. You will see the browser window open again, and the automated navigation flow.

$ jbang --deps com.microsoft.playwright:playwright:RELEASE Example.java

For more command options, run:

$ jbang playwright@microsoft --help

Azure Application Insights

To run a jbang program with the App Insights agent enabled, run:

$ jbang --javaagent applicationinsights-agent@microsoft <yourapp>

Where <yourapp> can be a single-source file script, a JAR, or even a GAV (Group, Artifact, Version coordinate) of an Apache Maven artifact.

To configure the agent, see the Azure Application Insights documentation.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.