2.4. Create the Maven project
You can either create a new Maven project with the oidc extension or you can add the extension to an existing Maven project. Complete one of the following commands:
To create a new Maven project, use the following command:
Using the Quarkus CLI:
quarkus create app org.acme:security-openid-connect-quickstart \ --extension='oidc,rest-jackson' \ --no-code cd security-openid-connect-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-quickstart \ -Dextensions='oidc,rest-jackson' \ -DnoCode cd security-openid-connect-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-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 will add the following to your build file:
Using Maven:
<dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-oidc</artifactId> </dependency>Using Gradle:
implementation("io.quarkus:quarkus-oidc")