diff --git a/.cursor/Dockerfile b/.cursor/Dockerfile new file mode 100644 index 0000000..113da1a --- /dev/null +++ b/.cursor/Dockerfile @@ -0,0 +1,17 @@ +FROM ubuntu:24.04 + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + ca-certificates \ + curl \ + git \ + maven \ + openjdk-21-jdk \ + && rm -rf /var/lib/apt/lists/* + +ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64 +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +USER ubuntu diff --git a/.cursor/environment.json b/.cursor/environment.json new file mode 100644 index 0000000..d59455a --- /dev/null +++ b/.cursor/environment.json @@ -0,0 +1,21 @@ +{ + "name": "Dux4J", + "build": { + "dockerfile": "Dockerfile", + "context": "." + }, + "user": "ubuntu", + "install": "./scripts/cloud-agent-install.sh", + "terminals": [ + { + "name": "bookstore-api", + "command": "cd spring-boot-starter && mvn spring-boot:run -q" + } + ], + "ports": [ + { + "name": "bookstore-api", + "port": 8080 + } + ] +} diff --git a/scripts/cloud-agent-install.sh b/scripts/cloud-agent-install.sh new file mode 100755 index 0000000..ef360f1 --- /dev/null +++ b/scripts/cloud-agent-install.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail + +export JAVA_HOME="${JAVA_HOME:-/usr/lib/jvm/java-21-openjdk-amd64}" +export PATH="${JAVA_HOME}/bin:${PATH}" + +mvn -f library-core/pom.xml install -DskipTests -Dmaven.javadoc.skip=true -Dgpg.skip=true -q +mvn -f spring-boot-starter/pom.xml package -DskipTests -q diff --git a/spring-boot-starter/pom.xml b/spring-boot-starter/pom.xml index cf2db51..303888f 100644 --- a/spring-boot-starter/pom.xml +++ b/spring-boot-starter/pom.xml @@ -38,7 +38,7 @@ dev.engineeringmadness dux4j - 2.0.0 + 3.4.0 org.springframework.boot diff --git a/spring-boot-starter/src/main/resources/application.properties b/spring-boot-starter/src/main/resources/application.properties index 8ada735..fd08a67 100644 --- a/spring-boot-starter/src/main/resources/application.properties +++ b/spring-boot-starter/src/main/resources/application.properties @@ -1,5 +1,5 @@ spring.application.name=dux-spring-boot-starter -spring.datasource.url=jdbc:sqlite:file:C:/Users/karan/Projects/dux4j/spring-boot-starter/src/main/resources/bookstore.db +spring.datasource.url=jdbc:sqlite:file:./src/main/resources/bookstore.db spring.datasource.driver-class-name=org.sqlite.JDBC spring.jpa.database-platform=org.hibernate.community.dialect.SQLiteDialect spring.jpa.hibernate.ddl-auto=update