Playing around with new JSR-375 (Security API) and Reference Implementation Soteria.
- Java 8
- Apache Maven
- PostgreSQL 9.5
- Payara Full Webserver
- Prepare user and database on PostgreSQL.
CREATE USER demo WITH PASSWORD 'password';
CREATE DATABASE soteriadb OWNER demo ENCODING 'UTF-8';
GRANT ALL PRIVILEGES ON DATABASE soteriadb TO demo;
- Execute
schema.sql
.
psql -U demo -d soteriadb -a -f ./src/main/resources/db/schema.sql
Download PostgreSQL jdbc driver
and put it into ${PAYARA_HOME}/glassfish/domains/${YOUR_DOMAIN}/lib
curl -o ${PAYARA_HOME}/glassfish/domains/${PAYARA_DOMAIN}/lib/postgresql-41.1.4.jar -L https://jdbc.postgresql.org/download/postgresql-42.1.4.jre6.jar
Make sure working directory on ${PAYARA_HOME}/bin
.
- Start Application Server.
./asadmin start-domain ${PAYARA_DOMAIN}
- Create JDBC Pool.
./asadmin create-jdbc-connection-pool \
--datasourceclassname org.postgresql.ds.PGConnectionPoolDataSource \
--restype javax.sql.ConnectionPoolDataSource \
--property User=demo:Password=password:DatabaseName=soteriadb:ServerName=localhost:PortNumber=5432 Soteria
- Create JDBC Resource.
./asadmin create-jdbc-resource --connectionpoolid Soteria jdbc/soteria
Being Maven centric, compile and package can be done:
mvn clean compile
mvn clean package
To simplified it can be done:
mvn clean install
Once you have the war file, you can deploy it.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.