Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions JtProject/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM eclipse-temurin:21-jre

WORKDIR /app

COPY JtSpringProject-0.0.1-SNAPSHOT.jar app.jar

EXPOSE 8080

ENTRYPOINT ["java","-jar","app.jar"]

6 changes: 6 additions & 0 deletions JtProject/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@
<version>8.0.33</version>
</dependency>

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;

@SpringBootApplication(exclude = HibernateJpaAutoConfiguration.class)
@SpringBootApplication(
exclude = {
org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration.class,
org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration.class
}
)
public class JtSpringProjectApplication {

public static void main(String[] args) {
SpringApplication.run(JtSpringProjectApplication.class, args);
}

public static void main(String[] args) {
SpringApplication.run(JtSpringProjectApplication.class, args);
}
}
49 changes: 17 additions & 32 deletions JtProject/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,40 +1,25 @@
# Server configuration
server.port=8080
server.port=${PORT:8080}
spring.mvc.view.prefix=/views/
spring.mvc.view.suffix=.jsp

#Database related properties
#database.driver=com.mysql.cj.jdbc.Driver
#database.url=jdbc:mysql://localhost:3306/ecomjava
#database.user=root
#database.password=
#
##Hibernate related properties
#hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
#hibernate.show_sql=true
#hibernate.format_sql=true
#hibernate.hbm2ddl.auto=update
# ===============================
# H2 DATABASE CONFIG
# ===============================

db.driver=org.h2.Driver
db.url=jdbc:h2:mem:testdb
db.username=sa
db.password=

# Hibernate
hibernate.dialect= org.hibernate.dialect.MySQL5Dialect
hibernate.show_sql= true
hibernate.hbm2ddl.auto= update
#entitymanager.packagesToScan:

spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
# ===============================
# HIBERNATE CONFIG
# ===============================

hibernate.dialect=org.hibernate.dialect.H2Dialect
hibernate.show_sql=true
hibernate.hbm2ddl.auto=update

db.driver= com.mysql.cj.jdbc.Driver
db.url= jdbc:mysql://localhost:3306/ecommjava?createDatabaseIfNotExist=true
db.username= root
db.password=
entitymanager.packagesToScan= com
entitymanager.packagesToScan=com.jtspringproject.JtSpringProject

#spring.datasource.url=jdbc:mysql://localhost:3306/ecommjava?createDatabaseIfNotExist=true
#spring.datasource.username=root
#spring.datasource.password=
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
#spring.jpa.show-sql=true
#spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
spring.h2.console.enabled=true
Loading