4.4. Create the Maven project
First, we need a new project. Create a new project by running the following command:
Using the Quarkus CLI:
quarkus create app org.acme:security-openid-connect-web-authentication-quickstart \ --extension='rest,oidc' \ --no-code cd security-openid-connect-web-authentication-quickstartTo create a Gradle project, add the
--gradleor--gradle-kotlin-dsloption.For more information about how to install and use the Quarkus CLI, see the Quarkus CLI guide.
Using Maven:
mvn com.redhat.quarkus.platform:quarkus-maven-plugin:3.20.1:create \ -DprojectGroupId=org.acme \ -DprojectArtifactId=security-openid-connect-web-authentication-quickstart \ -Dextensions='rest,oidc' \ -DnoCode cd security-openid-connect-web-authentication-quickstartTo create a Gradle project, add the
-DbuildTool=gradleor-DbuildTool=gradle-kotlin-dsloption.
For Windows users:
-
If using cmd, (don’t use backward slash
\and put everything on the same line) -
If using Powershell, wrap
-Dparameters in double quotes e.g."-DprojectArtifactId=security-openid-connect-web-authentication-quickstart"
If you already have your Quarkus project configured, you can add the oidc extension to your project by running the following command in your project base directory:
Using the Quarkus CLI:
quarkus extension add oidcUsing Maven:
./mvnw quarkus:add-extension -Dextensions='oidc'Using Gradle:
./gradlew addExtension --extensions='oidc'
This adds the following dependency to your build file:
Using Maven:
<dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-oidc</artifactId> </dependency>Using Gradle:
implementation("io.quarkus:quarkus-oidc")