Skip to content

Commit

Permalink
Merge pull request #129 from redhat-developer-demos/mvnw
Browse files Browse the repository at this point in the history
remove maven dependency and use ./mvnw instead
  • Loading branch information
kdubois authored Aug 21, 2023
2 parents ad3acb2 + f71c28b commit e1faaa7
Show file tree
Hide file tree
Showing 21 changed files with 36 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/price-generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
java-version: 11
- name: Maven build
working-directory: apps/price-generator
run: mvn package -Pnative -Dquarkus.native.container-build=true
run: ./mvnwpackage -Pnative -Dquarkus.native.container-build=true
2 changes: 1 addition & 1 deletion apps/price-generator/src/main/docker/Dockerfile.jvm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Before building the docker image run:
#
# mvn package
# ./mvnwpackage
#
# Then, build the image with:
#
Expand Down
2 changes: 1 addition & 1 deletion apps/price-generator/src/main/docker/Dockerfile.native
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Before building the docker image run:
#
# mvn package -Pnative -Dquarkus.native.container-build=true
# ./mvnwpackage -Pnative -Dquarkus.native.container-build=true
#
# Then, build the image with:
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ <h2>Why do you see this?</h2>

<h2>What can I do from here?</h2>

<p>If not already done, run the application in <em>dev mode</em> using: <code>mvn compile quarkus:dev</code>.
<p>If not already done, run the application in <em>dev mode</em> using: <code>./mvnwcompile quarkus:dev</code>.
</p>
<ul>
<li>Add REST resources, Servlets, functions and other services in <code>src/main/java</code>.</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ a|
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn package
./mvnwpackage
----
a|
Expand Down Expand Up @@ -60,7 +60,7 @@ a|
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn package -Dnative
./mvnwpackage -Dnative
----
a|
Expand Down Expand Up @@ -100,7 +100,7 @@ a|
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn quarkus:image-build \
./mvnwquarkus:image-build \
-Dnative
----
a|
Expand Down
6 changes: 3 additions & 3 deletions documentation/modules/ROOT/pages/basics.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn "io.quarkus.platform:quarkus-maven-plugin:create" \
./mvnw"io.quarkus.platform:quarkus-maven-plugin:create" \
-DprojectGroupId="com.redhat.developers" \
-DprojectArtifactId="tutorial-app" \
-DprojectVersion="1.0-SNAPSHOT" \
Expand Down Expand Up @@ -94,7 +94,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn clean test
./mvnwclean test
----
--
Expand Down Expand Up @@ -143,7 +143,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn quarkus:dev
./mvnwquarkus:dev
----
--
Expand Down
4 changes: 2 additions & 2 deletions documentation/modules/ROOT/pages/configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn clean test
./mvnwclean test
----
--
Expand Down Expand Up @@ -184,7 +184,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn quarkus:dev
./mvnwquarkus:dev
----
--
Expand Down
8 changes: 4 additions & 4 deletions documentation/modules/ROOT/pages/dev-services.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn quarkus:remove-extension -Dextension=quarkus-jdbc-h2
mvn quarkus:add-extension -Dextension=quarkus-jdbc-postgresql
./mvnwquarkus:remove-extension -Dextension=quarkus-jdbc-h2
./mvnwquarkus:add-extension -Dextension=quarkus-jdbc-postgresql
----
--
Expand Down Expand Up @@ -127,7 +127,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn test
./mvnwtest
----
--
Expand Down Expand Up @@ -265,7 +265,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn clean package -DskipTests -Dquarkus.container-image.push=true
./mvnwclean package -DskipTests -Dquarkus.container-image.push=true
----
--
Expand Down
2 changes: 1 addition & 1 deletion documentation/modules/ROOT/pages/fault-tolerance.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn quarkus:add-extension -Dextensions=quarkus-smallrye-fault-tolerance
./mvnwquarkus:add-extension -Dextensions=quarkus-smallrye-fault-tolerance
----
--
Expand Down
2 changes: 1 addition & 1 deletion documentation/modules/ROOT/pages/health.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn quarkus:add-extension -Dextension=quarkus-smallrye-health
./mvnwquarkus:add-extension -Dextension=quarkus-smallrye-health
----
--
Expand Down
2 changes: 1 addition & 1 deletion documentation/modules/ROOT/pages/kafka-and-streams.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn quarkus:add-extension -Dextensions=quarkus-smallrye-reactive-messaging-kafka
./mvnwquarkus:add-extension -Dextensions=quarkus-smallrye-reactive-messaging-kafka
----
--
Expand Down
4 changes: 2 additions & 2 deletions documentation/modules/ROOT/pages/kubernetes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn quarkus:add-extension -Dextensions=quarkus-kubernetes,quarkus-container-image-jib
./mvnwquarkus:add-extension -Dextensions=quarkus-kubernetes,quarkus-container-image-jib
----
--
Expand Down Expand Up @@ -90,7 +90,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn clean package -DskipTests -Dquarkus.container-image.push=true -Dquarkus.container-image.builder=jib
./mvnwclean package -DskipTests -Dquarkus.container-image.push=true -Dquarkus.container-image.builder=jib
----
--
Expand Down
4 changes: 2 additions & 2 deletions documentation/modules/ROOT/pages/metrics.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn quarkus:add-extension -Dextensions=quarkus-micrometer
./mvnwquarkus:add-extension -Dextensions=quarkus-micrometer
----
--
Expand All @@ -41,7 +41,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn quarkus:add-extension -Dextensions=quarkus-micrometer-registry-prometheus
./mvnwquarkus:add-extension -Dextensions=quarkus-micrometer-registry-prometheus
----
--
Expand Down
4 changes: 2 additions & 2 deletions documentation/modules/ROOT/pages/panache.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ We'll use http://www.h2database.com[H2,window="_blank"] as our backing database
Quarkus provides a lot of optimized dependencies to its ecosystem through *extensions*. For this particular chapter, we'll need to add extensions that enables us to work with H2, Hibernate ORM, Panache (a novel persistence API), and JSON.
You probably still have `mvn quarkus:dev` running in your terminal. And that's perfectly fine!
You probably still have `./mvnwquarkus:dev` running in your terminal. And that's perfectly fine!
Just open a new terminal window, and make sure you're at the root of your `{project-name}` project, then run:
Expand All @@ -26,7 +26,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn quarkus:add-extension -Dextension="quarkus-resteasy-reactive-jsonb, quarkus-jdbc-h2, quarkus-hibernate-orm-panache, quarkus-smallrye-openapi"
./mvnwquarkus:add-extension -Dextension="quarkus-resteasy-reactive-jsonb, quarkus-jdbc-h2, quarkus-hibernate-orm-panache, quarkus-smallrye-openapi"
----
--
Expand Down
4 changes: 2 additions & 2 deletions documentation/modules/ROOT/pages/reactive-messaging.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn quarkus:add-extension -Dextension=quarkus-smallrye-reactive-messaging
./mvnwquarkus:add-extension -Dextension=quarkus-smallrye-reactive-messaging
----
--
Expand Down Expand Up @@ -286,7 +286,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn quarkus:add-extension -Dextension=quarkus-smallrye-fault-tolerance
./mvnwquarkus:add-extension -Dextension=quarkus-smallrye-fault-tolerance
----
--
Expand Down
2 changes: 1 addition & 1 deletion documentation/modules/ROOT/pages/reactive.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn quarkus:add-extension -Dextension=quarkus-mutiny
./mvnwquarkus:add-extension -Dextension=quarkus-mutiny
----
--
Expand Down
2 changes: 1 addition & 1 deletion documentation/modules/ROOT/pages/rest-client.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn quarkus:add-extension -Dextensions=quarkus-rest-client-reactive,quarkus-rest-client-reactive-jsonb
./mvnwquarkus:add-extension -Dextensions=quarkus-rest-client-reactive,quarkus-rest-client-reactive-jsonb
----
--
Expand Down
2 changes: 1 addition & 1 deletion documentation/modules/ROOT/pages/security-oidc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn quarkus:add-extension -Dextensions=quarkus-oidc,quarkus-keycloak-authorization
./mvnwquarkus:add-extension -Dextensions=quarkus-oidc,quarkus-keycloak-authorization
----
--
Expand Down
2 changes: 1 addition & 1 deletion documentation/modules/ROOT/pages/security.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn quarkus:add-extension -Dextension=quarkus-smallrye-jwt
./mvnwquarkus:add-extension -Dextension=quarkus-smallrye-jwt
----
--
Expand Down
14 changes: 3 additions & 11 deletions documentation/modules/ROOT/pages/setup.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,10 @@ Please have them installed and configured before you get started with any of the
| https://podman-desktop.io/downloads[Podman Desktop for Mac, window="_blank"]
| https://podman-desktop.io/downloads[Podman Desktop for Linux, window="_blank"]
| https://podman-desktop.io/downloads[Podman Desktop for Windows, window="_blank"]
| **Java 17**
| `brew tap AdoptOpenJDK/openjdk && brew cask install adoptopenjdk17`
| `dnf install java-17-openjdk.x86_64`
| https://adoptopenjdk.net[Windows] (Make sure you set the `JAVA_HOME` environment variable and add `%JAVA_HOME%\bin` to your `PATH`)
| **Apache Maven 3.8.1+**
| `brew install maven`
| `dnf install maven`
| https://maven.apache.org/download.cgi[Windows] (Make sure you set the `MAVEN_HOME` environment variable and add `%MAVEN_HOME%\bin` to your `PATH`)
| **Graal VM**
| https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-{graalvm-version}/graalvm-ce-java17-darwin-amd64-{graalvm-version}.tar.gz[GraalVM Community Edition {graalvm-version}]
| https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-{graalvm-version}/graalvm-ce-java17-linux-amd64-{graalvm-version}.tar.gz[GraalVM Community Edition {graalvm-version}]
Expand All @@ -67,15 +60,14 @@ Please have them installed and configured before you get started with any of the
[TIP]
=====
You can also install Java and Maven using https://sdkman.io[SDKMAN!]. This allows easy version/distribution switching (and you can install the Quarkus CLI with it as well)
You can also install Java using https://sdkman.io[SDKMAN!]. This allows easy version/distribution switching (and you can install the Quarkus CLI with it as well)
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install java
sdk install maven
sdk install quarkus
----
=====
Expand All @@ -92,13 +84,13 @@ mkdir quarkus-tutorial
cd quarkus-tutorial
mkdir work
docker run -ti -p 8080:8080 -v `pwd`/work:/work \
-v `mvn help:evaluate -Dexpression=settings.localRepository | grep \
-v `./mvnwhelp:evaluate -Dexpression=settings.localRepository | grep \
-v '\[INFO\]' | grep -v '\[WARNING\]'`:/opt/developer/.m2/repository \
--rm quay.io/rhdevelopers/tutorial-tools:0.0.7 bash
# -p will map Quarkus running in the container to your host port
# -v `pwd`... will map the host work subdirectory to the container /work directory, this is where you will create your application
# -v `mvn ...` will map your ~/.m2/repository of your host to the container repository to save downloading again between image runs
# -v `./mvnw...` will map your ~/.m2/repository of your host to the container repository to save downloading again between image runs
-----
[TIP]
Expand Down
4 changes: 2 additions & 2 deletions documentation/modules/ROOT/pages/spring.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Maven::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn quarkus:remove-extension -Dextensions=quarkus-resteasy-reactive
mvn quarkus:add-extension -Dextensions=quarkus-spring-web,quarkus-spring-data-jpa,quarkus-resteasy-reactive-jackson
./mvnwquarkus:remove-extension -Dextensions=quarkus-resteasy-reactive
./mvnwquarkus:add-extension -Dextensions=quarkus-spring-web,quarkus-spring-data-jpa,quarkus-resteasy-reactive-jackson
----
--
Expand Down

0 comments on commit e1faaa7

Please sign in to comment.