All Downloads are FREE. Search and download functionalities are using the official Maven repository.

archetype-resources.README.md Maven / Gradle / Ivy

# Payara Starter Project

This is a sample application generated by the Payara Starter.

#[[##]]# Getting Started

#[[###]]# Prerequisites

- [Java SE ${javaVersion}+](https://adoptium.net/?variant=openjdk${javaVersion})
#if (${build} == 'maven')
- [Maven](https://maven.apache.org/download.cgi)
#else
- [Gradle](https://gradle.org/install/)
#end

#[[##]]# Running the Application

To run the application locally, follow these steps:

1. Open a terminal and navigate to the project's root directory.

2. Make sure you have the appropriate Java version installed. We have tested with Java SE 8, Java SE 11, Java SE 17, and Java SE 21.

3. Execute the following command:

```
#if (${build} == 'maven')
#if (${platform} == 'server')
./mvn clean package cargo:run
#else
#if (${javaVersion} == '8')
./mvn clean package payara-micro:start
#else
./mvn clean package payara-micro:dev
#end
#end
#else
#if (${platform} == 'server')
./gradle build
#else
./gradle build microStart
#end
#end
```

#if (${platform} == 'server')
4. Once the runtime starts, you can access the project at http://localhost:8080/${artifactId}
#else
4. Once the runtime starts, you can access the project at http://localhost:8080/
#end

#if (${cloud} == 'true')
#[[##]]# Deploying to Payara Cloud
To deploy the application to Payara Cloud follow these steps:

#if (${build} == 'maven')
Open a terminal and navigate to the project's root directory.
Execute the following Maven command to build the application and deploy to the Payara Cloud:

```
./mvn clean package payara-cloud:dev
```
#end
#end

#if (${docker} == 'true')
#[[##]]# Building a Docker Image
To build a Docker image for this application follow these steps:

#if (${build} == 'maven')
Open a terminal and navigate to the project's root directory. Make sure you have Docker installed and running on your system.
Execute the following Maven command to build the Docker image:

```
mvn docker:build
```

This command will build a Docker image for your application.

Once the image is built, you can run a Docker container from the image using the following command:

```
docker run -p 8080:8080 ${artifactId}:${project.version}
```
Replace ${artifactId}:${project.version} with the actual image name and tag.
#else
Open a terminal and navigate to the project's root directory. Make sure you have Docker installed and running on your system.
Execute the following Gradle command to build the Docker image:

```
gradle buildDockerImage
```

This command will build a Docker image for your application.

Once the image is built, you can run a Docker container from the image using the following command:

```
gradle startDockerContainer
```
#end

That's it! You have successfully built and run the application in a Docker container.
#end

#if (${auth} == 'formAuthFileRealm')
#[[###]]# Adding a User for Form-Based Authentication with File Realm
If you are using form-based authentication with file realm, you can create a user with the following command:

```
asadmin create-file-user --groups=user --target=server-config --authrealmname=file myuser
```
This command creates a user with the username `myuser` and assigns them to the `user` group. You can adjust the username and group as needed for your authentication setup.
#end

#if (${auth} == 'formAuthDB')
#[[###]]# Existing Users for Form-Based Authentication with Database 
The application currently has two existing users with the following credentials:

- **User**: myuser
  - **Password**: secret
  - **Roles**: user

- **Admin**: myadmin
  - **Password**: secret
  - **Roles**: admin, user

Use these credentials to log in and test the application.
#end

#if (${auth} == 'formAuthLDAP')
#[[###]]# Existing Users for Form-Based Authentication with LDAP
The application integrates with an embedded LDAP server, and you can adjust the LDAP user details for testing by modifying the "ldap-test.ldif" file located in the resources directory.

By default, the application includes the following LDAP users for testing:

- **User**: myuser
  - **Password**: secret
  - **Roles**: user

- **Admin**: myadmin
  - **Password**: secret
  - **Roles**: admin, user

Use these credentials to log in and test the application.
#end




© 2015 - 2024 Weber Informatics LLC | Privacy Policy