Skip to content

Commit 6a2afe8

Browse files
Spring boot run in Heroku
1 parent f390f54 commit 6a2afe8

File tree

3 files changed

+20
-28
lines changed

3 files changed

+20
-28
lines changed

Procfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
web: java $JAVA_OPTS -jar target/dependency/jetty-runner.jar --port $PORT target/*.war
1+
web: java -Dserver.port=$PORT -jar target/*.jar

pom.xml

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,17 @@
7373
<artifactId>spring-boot-devtools</artifactId>
7474
<scope>runtime</scope>
7575
</dependency>
76-
<!--<dependency>
77-
<groupId>mysql</groupId>
78-
<artifactId>mysql-connector-java</artifactId>
79-
<scope>runtime</scope>
80-
</dependency>-->
76+
<dependency>
77+
<groupId>org.springframework.boot</groupId>
78+
<artifactId>spring-boot-starter-jdbc</artifactId>
79+
</dependency>
80+
<dependency>
81+
<groupId>org.postgresql</groupId>
82+
<artifactId>postgresql</artifactId>
83+
</dependency>
84+
8185

82-
<!--Jaxb for java 11-->
86+
<!--Jaxb for java 11-->
8387
<!-- API, java.xml.bind module -->
8488
<dependency>
8589
<groupId>jakarta.xml.bind</groupId>
@@ -152,27 +156,6 @@
152156

153157
<build>
154158
<plugins>
155-
<plugin>
156-
<groupId>org.apache.maven.plugins</groupId>
157-
<artifactId>maven-dependency-plugin</artifactId>
158-
<version>2.4</version>
159-
<executions>
160-
<execution>
161-
<phase>package</phase>
162-
<goals><goal>copy</goal></goals>
163-
<configuration>
164-
<artifactItems>
165-
<artifactItem>
166-
<groupId>org.eclipse.jetty</groupId>
167-
<artifactId>jetty-runner</artifactId>
168-
<version>9.4.9.v20180320</version>
169-
<destFileName>jetty-runner.jar</destFileName>
170-
</artifactItem>
171-
</artifactItems>
172-
</configuration>
173-
</execution>
174-
</executions>
175-
</plugin>
176159
<plugin>
177160
<groupId>org.springframework.boot</groupId>
178161
<artifactId>spring-boot-maven-plugin</artifactId>

src/main/resources/application.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ spring.jpa.hibernate.ddl-auto=update
3434

3535

3636

37+
spring.datasource.driverClassName=org.postgresql.Driver
38+
spring.datasource.maxActive=10
39+
spring.datasource.maxIdle=5
40+
spring.datasource.minIdle=2
41+
spring.datasource.initialSize=5
42+
spring.datasource.removeAbandoned=true
43+
44+
45+
3746
## Hibernate Properties
3847
# The SQL dialect makes Hibernate generate better SQL for the chosen database
3948
#spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect

0 commit comments

Comments
 (0)