generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 11
Update Spring CLI #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Update Spring CLI #170
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f6d99f8
Moved directory to root
andytael 904e500
Update to Spring 3.3.8 and fix README
andytael c71050b
Merge branch 'main' into 169-springcli
andytael 4120cc3
Bump versions & initial README
andytael 0e72665
SB 3.4.x
andytael 7d938aa
Fixes and updates
andytael 3925ea5
Updates to run locally
andytael 4710d2d
Java 21
andytael e5e631a
pom cleanup
andytael 6e7c7f8
local testing fixes
andytael 416ba1e
Updates
andytael f3855ae
Fixes
andytael File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,3 +42,4 @@ build/ | |
.run | ||
target/ | ||
Thumbs.db | ||
run-app.sh |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
2 changes: 0 additions & 2 deletions
2
database/spring-cli/projects/obaas/.mvn/wrapper/maven-wrapper.properties
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Spring CLI integration | ||
|
||
Spring CLI integration with a project catalog to help you create Spring Boot projects using Oracle and [Oracle Backend for Microservices and AI](https://bit.ly/OracleAI-microservices). | ||
|
||
## Install Spring CLI | ||
|
||
The goal of the Spring CLI is to increase your productivity when you create new projects and when you add functionality to existing projects. [Spring CLI documentation](https://docs.spring.io/spring-cli/reference/index.html) describes how to install the CLI on various platforms. | ||
|
||
## Add to Spring CLI | ||
|
||
Execute the following command to add the `project-catalog` for [Oracle Backend for Microservices and AI](https://bit.ly/OracleAI-microservices). | ||
|
||
```shell | ||
spring add..... | ||
``` | ||
|
||
The Spring CLI is now aware of the [Oracle Backend for Microservices and AI](https://bit.ly/OracleAI-microservices) integration so when building a new project (or adding to a current one) you can use the command `spring .....` | ||
|
||
## Run the Spring CLI application locally | ||
|
||
To run the application locally you need access to an Oracle Database (remotly or locally). Create a shell script with the following content called `run-app.sh` | ||
|
||
```shell | ||
#!/bin/bash | ||
export spring_datasource_url=<URL to database> | ||
export liquibase_datasource_username=<Liquibase database user> | ||
export liquibase_datasource_password=<Liquibase database user password> | ||
export spring_datasource_username=<Application database user> | ||
export spring_datasource_password=<Application database user password> | ||
export otel_exporter_otlp_endpoint=http://localhost:8080 # Fake URL | ||
./mvnw spring-boot:run -Dspring-boot.run.profiles=local | ||
``` | ||
|
||
The Spring profile `local` turns off Eureka discovery and OTLP tracing. | ||
|
||
Execute the shell script running the following command: | ||
|
||
```shell | ||
source run-app.sh | ||
``` | ||
|
||
You can see a few `WARNINGS` with this message which can be ignored: | ||
|
||
```log | ||
WARNING: | ||
|
||
Liquibase detected the following invalid LIQUIBASE_* environment variables: | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
project-repositories: | ||
- name: "obaas" | ||
description: "RESTful Hello World service for Oracle Backend Microservices and AI" | ||
url: "https://github.com/oracle/spring-cloud-oci/tree/main/spring-cli/projects/obaas" | ||
tags: | ||
- "obaas" | ||
- "java-17" | ||
- "rest" | ||
- "web" | ||
- "boot-3.4.x" |
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ase/spring-cli/projects/obaas/README.adoc → spring-cli/projects/obaas/README.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
spring-cli/projects/obaas/src/main/resources/application-local.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# | ||
# This is an example Spring application.yaml configuration file for a | ||
# Spring Boot application that can be deployed to Oracle Backend for | ||
# Spring Boot and Microservices. | ||
# | ||
spring: | ||
application: | ||
name: restservice | ||
threads: | ||
virtual: | ||
enabled: true | ||
jpa: | ||
hibernate: | ||
ddl-auto: validate | ||
properties: | ||
hibernate: | ||
dialect: org.hibernate.dialect.OracleDialect | ||
format_sql: true | ||
show-sql: true | ||
|
||
# This section configures Liquibase to automate the schema and reference | ||
# data based on the definitions under src/main/resources/db/changelog. | ||
# Comment out this section if you do not need Liquibase. | ||
# Note that the variables used here will be injected into the deployment | ||
# automatically when you deploy with oractl or the IDE plugins. | ||
liquibase: | ||
change-log: classpath:db/changelog/controller.yaml | ||
url: ${spring.datasource.url} | ||
user: ${liquibase.datasource.username} | ||
password: ${liquibase.datasource.password} | ||
enabled: ${LIQUIBASE_ENABLED:true} | ||
|
||
# This section configures an Oracle datasource using UCP. You can adjust | ||
# the pool sizing parameters below in the oracleucp section. | ||
# Note that the variables used here will be injected into the deployment | ||
# automatically when you deploy with oractl or the IDE plugins. | ||
datasource: | ||
url: ${spring.datasource.url} | ||
username: ${spring.datasource.username} | ||
password: ${spring.datasource.password} | ||
driver-class-name: oracle.jdbc.OracleDriver | ||
type: oracle.ucp.jdbc.PoolDataSource | ||
oracleucp: | ||
connection-factory-class-name: oracle.jdbc.pool.OracleDataSource | ||
connection-pool-name: SpringCLIConnectionPool | ||
initial-pool-size: 15 | ||
min-pool-size: 10 | ||
max-pool-size: 30 | ||
shared: true | ||
|
||
# This section configures service discovery using the Spring Cloud Eureka Service | ||
# Registry that is automatically installed and configured in Oracle Backend for | ||
# Spring Boot and Microservices. Note that it must be configured to use IP address | ||
# not hostname since the deployment is in Kubernetes and the hostname allocated to | ||
# pod will not match. | ||
eureka: | ||
instance: | ||
hostname: ${spring.application.name} | ||
preferIpAddress: true | ||
client: | ||
service-url: | ||
defaultZone: ${eureka.service-url} | ||
fetch-registry: true | ||
register-with-eureka: true | ||
enabled: false | ||
|
||
# This section configures tracing and metrics | ||
management: | ||
endpoint: | ||
health: | ||
show-details: always | ||
endpoints: | ||
web: | ||
exposure: | ||
include: "*" | ||
metrics: | ||
tags: | ||
application: ${spring.application.name} | ||
tracing: | ||
sampling: | ||
probability: 1.0 | ||
info: | ||
os: | ||
enabled: true | ||
env: | ||
enabled: true | ||
java: | ||
enabled: true | ||
otlp: | ||
tracing: | ||
endpoint: ${otel.exporter.otlp.endpoint} | ||
export: | ||
enabled: false | ||
|
||
logging: | ||
level: | ||
root: INFO | ||
com.example: INFO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../src/main/resources/db/changelog/data.sql → .../src/main/resources/db/changelog/data.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...src/main/resources/db/changelog/table.sql → ...src/main/resources/db/changelog/table.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.