Skip to content

Commit

Permalink
Migrate to spring boot 3.0 (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
EugenMayer authored Jan 28, 2023
1 parent 7d82a57 commit 8b57598
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 21 deletions.
9 changes: 9 additions & 0 deletions .run/ConverterApplication.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="ConverterApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<module name="officeconverter.main" />
<option name="SPRING_BOOT_MAIN_CLASS" value="de.kontextwork.converter.ConverterApplication" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
30 changes: 19 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## WAT

Offers a (i think production ready) REST service to convert files like PDF, docx,xlx .. odt .. you get it.. to other formats like pdf, png, doc, pdt, html.
This project is basically an extended version of [jodconverter-sample-rest](https://github.com/jodconverter/jodconverter/tree/master/jodconverter-samples/jodconverter-sample-rest)
This project is basically an extended version of [jodconverter-samples-rest](https://github.com/jodconverter/jodconverter-samples/tree/main/samples/spring-boot-rest)

You can use this project as it is using docker with `ghcr.io/eugenmayer/kontextwork-converter` or build it here yourself.

Expand Down Expand Up @@ -59,7 +59,7 @@ This fires up a docker container, mounts your source. To auto-rebuild and auto-r

## Debugging

Of course you can just start using your IDE and debug that, but if you want to debug inside the docker container
Of course, you can just start using your IDE and debug that, but if you want to debug inside the docker container

make start

Expand All @@ -76,20 +76,28 @@ CI based on tags

## Configuration

You can configure the docker images by mounting `/etc/app/application.properties` and put whatever you like into them.
You can configure the docker images by mounting `/etc/app/application.yml` and put whatever you like into them.

For example if you like to have 2 LibreOffice instances, you would put into the file

```properties
```yaml
# amount of libreOffice instances to start - one for each given port. So this means 2
jodconverter.local.port-numbers: 2002, 2003
# change the tmp folder
jodconverter.local.working-dir: /tmp
jodconverter:
local:
port-numbers:
- 2002
- 2003
# change the tmp folder
working-dir: /tmp
# change upload sizes
spring.servlet.multipart.max-file-size: 5MB
spring.servlet.multipart.max-request-size: 5MB
# change the server port (where the REST app is listenting
server.port=8090
spring:
servlet:
multipart:
max-file-size: 5MB
max-request-size: 5MB
# change the server port (where the REST app is listenting)
server:
portL: 8090
```
### Adding addition document formats
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext {
// @see https://mvnrepository.com/artifact/org.jodconverter/jodconverter-local
jodconverterVersion = '4.4.5'
jodconverterVersion = '4.4.6'

// @see https://mvnrepository.com/artifact/org.mockito/mockito-core
mockitoVersion = '4.11.0'
mockitoVersion = '5.0.0'

// @see https://mvnrepository.com/artifact/org.apache.tika/tika-parsers
// @see https://mvnrep1ository.com/artifact/org.apache.tika/tika-parsers
tikaVersion = '2.6.0'

// @see https://mvnrepository.com/artifact/org.projectlombok/lombok
Expand All @@ -33,7 +33,7 @@ plugins {

// @see https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web
// changing that will upgrade spring to the corresponding version
id 'org.springframework.boot' version '2.7.7'
id 'org.springframework.boot' version '3.0.2'

// much better output during running tests
// see https://github.com/radarsh/gradle-test-logger-plugin for configuration options
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
org.gradle.caching=true
#org.gradle.parallel=true
org.gradle.unsafe.configuration-cache=true
org.gradle.unsafe.configuration-cache=false
9 changes: 9 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
rootProject.name = 'officeconverter'
// Composite build for library development
//includeBuild("../jodconverter") {
// dependencySubstitution {
// substitute module('org.jodconverter:jodconverter-local') using project(':jodconverter-local')
// substitute module('org.jodconverter:jodconverter-remote') using project(':jodconverter-remote')
// substitute module('org.jodconverter:jodconverter-spring') using project(':jodconverter-spring')
// substitute module('org.jodconverter:jodconverter-spring-boot-starter') using project(':jodconverter-spring-boot-starter')
// }
//}
4 changes: 4 additions & 0 deletions src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
spring:
config:
activate:
on-profile: prod
logging:
level:
org.jodconverter: debug
5 changes: 4 additions & 1 deletion src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
---
spring.profiles: prod
spring:
config:
activate:
on-profile: prod
6 changes: 2 additions & 4 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ server:
port: 8080

spring:
profiles:
# that is our default profile
active: prod
servlet:
multipart:
max-file-size: 20MB
Expand All @@ -17,7 +14,8 @@ spring:
jodconverter:
local:
enabled: true
port-numbers: 2002
port-numbers:
- 2002
working-dir: /tmp
format-options:
html:
Expand Down

0 comments on commit 8b57598

Please sign in to comment.