Skip to content
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

Feat/upgrade java versions - 17 #1317

Merged
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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ To customise the namespaces and create an application for your company please vi

1. Clone one of the Java projects to your local machine from one of the following repos:
---
1. Simple web API: [stacks-java repository](https://github.com/amido/stacks-java)
2. Web API with CQRS: [stacks-java-cqrs repository](https://github.com/amido/stacks-java-cqrs)
3. Web API with CQRS and events: [stacks-java-cqrs-events repository](https://github.com/amido/stacks-java-cqrs-events)
1. Simple web API: [stacks-java repository](https://github.com/Ensono/stacks-java)
2. Web API with CQRS: [stacks-java-cqrs repository](https://github.com/Ensono/stacks-java-cqrs)
3. Web API with CQRS and events: [stacks-java-cqrs-events repository](https://github.com/Ensono/stacks-java-cqrs-events)

2. Build and run the application
---

Note that at a minimum [Java 11](https://adoptopenjdk.net/) should be installed.
Note that at a minimum [Java 17](https://adoptopenjdk.net/) should be installed.

Move to the `<PROJECT-NAME>/java` folder, then

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pipeline {
// e.g.:
// args '-v /var/run/docker.sock:/var/run/docker.sock -u 1000:999'
// Please check with your admin on any required steps you need to take to ensure a SUDOers access inside the containers
image "azul/zulu-openjdk-debian:11"
image "azul/zulu-openjdk-debian:17"
}
}

Expand Down Expand Up @@ -215,7 +215,7 @@ pipeline {
agent {
docker {
// add additional args if you need to here
image "azul/zulu-openjdk-debian:11"
image "azul/zulu-openjdk-debian:17"
}
}

Expand Down Expand Up @@ -364,7 +364,7 @@ pipeline {
agent {
docker {
// add additional args if you need to here
image "azul/zulu-openjdk-debian:11"
image "azul/zulu-openjdk-debian:17"
}
}

Expand Down Expand Up @@ -866,7 +866,7 @@ pipeline {
stage("PostDeployDev") {
agent {
docker {
image "azul/zulu-openjdk-debian:11"
image "azul/zulu-openjdk-debian:17"
}
}

Expand Down
6 changes: 6 additions & 0 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<exec-maven-plugin.version>3.0.0</exec-maven-plugin.version>
<spring.cloud.dependencies.version>2022.0.4</spring.cloud.dependencies.version>
<pact.version>3.5.24</pact.version>
<spring.data.commons>3.3.1</spring.data.commons>

<!-- Set 'pact.broker.url' and 'pact.broker.token' -->
<pact.broker.url/>
Expand Down Expand Up @@ -237,6 +238,11 @@
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>${spring.data.commons}</version>
</dependency>

</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;

/** ApplicationConfig - Configuration class for Auth0 application security. */
@Configuration("MySecurityConfig")
@Configuration("mySecurityConfig")
@EnableWebSecurity
@Order(Ordered.HIGHEST_PRECEDENCE)
public class ApplicationConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public WebSecurityCustomizer webSecurityCustomizer() {
* @param http
* @throws Exception
*/
@Bean(name = "test_SecurityFilterChain")
@Bean(name = "testSecurityFilterChain")
public SecurityFilterChain configure(HttpSecurity http) throws Exception {
http.authorizeHttpRequests(auth -> auth.requestMatchers("**/*").anonymous())
.httpBasic(withDefaults());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
scheme = "bearer")
public class OpenApiConfiguration {

private static final String PROJECT_URL = "https://github.com/amido/stacks-java";
private static final String STACKS_EMAIL = "stacks@amido.com";
private static final String PROJECT_URL = "https://github.com/Ensono/stacks-java";
private static final String STACKS_EMAIL = "stacks@ensono.com";
private static final String SPRING_DOC = "http://springdoc.org";

/** OAS/Swagger Configuration. */
Expand All @@ -38,7 +38,7 @@ public OpenAPI customOpenApi() {
.title("Menu API")
.version("1.0")
.description("APIs used to interact and manage menus for a restaurant")
.contact(new Contact().name("Amido").url(PROJECT_URL).email(STACKS_EMAIL))
.contact(new Contact().name("Ensono").url(PROJECT_URL).email(STACKS_EMAIL))
.license(new License().name("Apache 2.0").url(SPRING_DOC)));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
package com.amido.stacks.workloads.menu.domain;

import jakarta.persistence.Id;
import java.util.ArrayList;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import org.springframework.data.annotation.Id;

@Data
@AllArgsConstructor
@Builder
public class Menu {

@Id private String id;
@Id
private String id;

private String restaurantId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public SearchMenuResult search(
return new SearchMenuResult(
pageSize,
pageNumber,
menuList.stream().map(searchMenuResultItemMapper::toDto).collect(Collectors.toList()));
menuList.stream().map(searchMenuResultItemMapper::toDto).toList());
}

public MenuDTO get(UUID id, String correlationId) {
Expand Down
2 changes: 1 addition & 1 deletion java/src/main/resources/application-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ azure:
enabled: true
keyvault:
enabled: false
uri: https://amido.stacks-tmp.vault.azure.net/
uri: https://ensono.stacks-tmp.vault.azure.net/
client-id: xxxxxx
client-key: xxxxxx
tenant-id: xxxxxx
8 changes: 4 additions & 4 deletions java/src/main/resources/auth.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#The issuer of the JWT Token. Typically, this is your Auth0 domain with an https://
auth.issuer=https://amidostacks.eu.auth0.com/
auth.issuer=https://ensonostacks.eu.auth0.com/

#The unique identifier for your API
auth.apiAudience=https://amidostacks.eu.auth0.com/api/v2/
auth.apiAudience=https://ensonostacks.eu.auth0.com/api/v2/

#Config switch to enable (true) or disable(false) Auth0.Provide either true or false to enable or disable
auth.isEnabled=false

auth.resource.url=https://amidostacks.eu.auth0.com/oauth/tokenLocal
auth.resource.url=https://ensonostacks.eu.auth0.com/oauth/tokenLocal

auth.token.url=/v1/tokenLocal
auth.token.url=/v1/tokenLocal
2 changes: 1 addition & 1 deletion java/src/main/resources/local/application-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ azure:
enabled: true
keyvault:
enabled: false
uri: https://amido.stacks-tmp.vault.azure.net/
uri: https://ensono.stacks-tmp.vault.azure.net/
client-id: xxxxxx
client-key: xxxxxx
tenant-id: xxxxxx
2 changes: 1 addition & 1 deletion stackscli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ framework:
name: java
commands:
- name: java
version: ">= 11"
version: ">= 17"

# Pipeline files
pipeline:
Expand Down
4 changes: 2 additions & 2 deletions stacksclipom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<version>1.0.0</version>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<main.basedir>.</main.basedir>
<source.basedir>${main.basedir}/stacks</source.basedir>
<build.basedir>${main.basedir}/build</build.basedir>
Expand Down