-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
quarkusio
committed
Dec 7, 2024
0 parents
commit 31b1946
Showing
20 changed files
with
1,269 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* | ||
!target/*-runner | ||
!target/*-runner.jar | ||
!target/lib/* | ||
!target/quarkus-app/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
## A basic GitHub Actions workflow for your Quarkus application. | ||
|
||
name: CI build | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 21 | ||
distribution: temurin | ||
cache: maven | ||
- name: Build | ||
run: ./mvnw verify -B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#Maven | ||
target/ | ||
pom.xml.tag | ||
pom.xml.releaseBackup | ||
pom.xml.versionsBackup | ||
release.properties | ||
.flattened-pom.xml | ||
|
||
# Eclipse | ||
.project | ||
.classpath | ||
.settings/ | ||
bin/ | ||
|
||
# IntelliJ | ||
.idea | ||
*.ipr | ||
*.iml | ||
*.iws | ||
|
||
# NetBeans | ||
nb-configuration.xml | ||
|
||
# Visual Studio Code | ||
.vscode | ||
.factorypath | ||
|
||
# OSX | ||
.DS_Store | ||
|
||
# Vim | ||
*.swp | ||
*.swo | ||
|
||
# patch | ||
*.orig | ||
*.rej | ||
|
||
# Local environment | ||
.env | ||
|
||
# Plugin directory | ||
/.quarkus/cli/plugins/ | ||
# TLS Certificates | ||
.certs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
maven-wrapper.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.net.Authenticator; | ||
import java.net.PasswordAuthentication; | ||
import java.net.URI; | ||
import java.net.URL; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.nio.file.StandardCopyOption; | ||
import java.util.concurrent.ThreadLocalRandom; | ||
|
||
public final class MavenWrapperDownloader { | ||
private static final String WRAPPER_VERSION = "3.3.2"; | ||
|
||
private static final boolean VERBOSE = Boolean.parseBoolean(System.getenv("MVNW_VERBOSE")); | ||
|
||
public static void main(String[] args) { | ||
log("Apache Maven Wrapper Downloader " + WRAPPER_VERSION); | ||
|
||
if (args.length != 2) { | ||
System.err.println(" - ERROR wrapperUrl or wrapperJarPath parameter missing"); | ||
System.exit(1); | ||
} | ||
|
||
try { | ||
log(" - Downloader started"); | ||
final URL wrapperUrl = URI.create(args[0]).toURL(); | ||
final String jarPath = args[1].replace("..", ""); // Sanitize path | ||
final Path wrapperJarPath = Paths.get(jarPath).toAbsolutePath().normalize(); | ||
downloadFileFromURL(wrapperUrl, wrapperJarPath); | ||
log("Done"); | ||
} catch (IOException e) { | ||
System.err.println("- Error downloading: " + e.getMessage()); | ||
if (VERBOSE) { | ||
e.printStackTrace(); | ||
} | ||
System.exit(1); | ||
} | ||
} | ||
|
||
private static void downloadFileFromURL(URL wrapperUrl, Path wrapperJarPath) | ||
throws IOException { | ||
log(" - Downloading to: " + wrapperJarPath); | ||
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { | ||
final String username = System.getenv("MVNW_USERNAME"); | ||
final char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); | ||
Authenticator.setDefault(new Authenticator() { | ||
@Override | ||
protected PasswordAuthentication getPasswordAuthentication() { | ||
return new PasswordAuthentication(username, password); | ||
} | ||
}); | ||
} | ||
Path temp = wrapperJarPath | ||
.getParent() | ||
.resolve(wrapperJarPath.getFileName() + "." | ||
+ Long.toUnsignedString(ThreadLocalRandom.current().nextLong()) + ".tmp"); | ||
try (InputStream inStream = wrapperUrl.openStream()) { | ||
Files.copy(inStream, temp, StandardCopyOption.REPLACE_EXISTING); | ||
Files.move(temp, wrapperJarPath, StandardCopyOption.REPLACE_EXISTING); | ||
} finally { | ||
Files.deleteIfExists(temp); | ||
} | ||
log(" - Downloader complete"); | ||
} | ||
|
||
private static void log(String msg) { | ||
if (VERBOSE) { | ||
System.out.println(msg); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
wrapperVersion=3.3.2 | ||
distributionType=source | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip | ||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# myspotify | ||
|
||
This project uses Quarkus, the Supersonic Subatomic Java Framework. | ||
|
||
If you want to learn more about Quarkus, please visit its website: <https://quarkus.io/>. | ||
|
||
## Running the application in dev mode | ||
|
||
You can run your application in dev mode that enables live coding using: | ||
|
||
```shell script | ||
./mvnw quarkus:dev | ||
``` | ||
|
||
> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at <http://localhost:8080/q/dev/>. | ||
## Packaging and running the application | ||
|
||
The application can be packaged using: | ||
|
||
```shell script | ||
./mvnw package | ||
``` | ||
|
||
It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory. | ||
Be aware that it’s not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory. | ||
|
||
The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`. | ||
|
||
If you want to build an _über-jar_, execute the following command: | ||
|
||
```shell script | ||
./mvnw package -Dquarkus.package.jar.type=uber-jar | ||
``` | ||
|
||
The application, packaged as an _über-jar_, is now runnable using `java -jar target/*-runner.jar`. | ||
|
||
## Creating a native executable | ||
|
||
You can create a native executable using: | ||
|
||
```shell script | ||
./mvnw package -Dnative | ||
``` | ||
|
||
Or, if you don't have GraalVM installed, you can run the native executable build in a container using: | ||
|
||
```shell script | ||
./mvnw package -Dnative -Dquarkus.native.container-build=true | ||
``` | ||
|
||
You can then execute your native executable with: `./target/myspotify-1.0.0-SNAPSHOT-runner` | ||
|
||
If you want to learn more about building native executables, please consult <https://quarkus.io/guides/maven-tooling>. | ||
|
||
## Related Guides | ||
|
||
- REST ([guide](https://quarkus.io/guides/rest)): A Jakarta REST implementation utilizing build time processing and Vert.x. This extension is not compatible with the quarkus-resteasy extension, or any of the extensions that depend on it. | ||
- REST Jackson ([guide](https://quarkus.io/guides/rest#json-serialisation)): Jackson serialization support for Quarkus REST. This extension is not compatible with the quarkus-resteasy extension, or any of the extensions that depend on it | ||
- Hibernate ORM with Panache ([guide](https://quarkus.io/guides/hibernate-orm-panache)): Simplify your persistence code for Hibernate ORM via the active record or the repository pattern | ||
- JDBC Driver - PostgreSQL ([guide](https://quarkus.io/guides/datasource)): Connect to the PostgreSQL database via JDBC | ||
|
||
## Provided Code | ||
|
||
### Hibernate ORM | ||
|
||
Create your first JPA entity | ||
|
||
[Related guide section...](https://quarkus.io/guides/hibernate-orm) | ||
|
||
[Related Hibernate with Panache section...](https://quarkus.io/guides/hibernate-orm-panache) | ||
|
||
|
||
### REST | ||
|
||
Easily start your REST Web Services | ||
|
||
[Related guide section...](https://quarkus.io/guides/getting-started-reactive#reactive-jax-rs-resources) |
Oops, something went wrong.