Skip to content

Commit

Permalink
Merge pull request #175 from entur/spring-boot-3-java21-update
Browse files Browse the repository at this point in the history
Spring boot 3 java21 update
  • Loading branch information
assadriaz authored Apr 16, 2024
2 parents d59189d + 0c3dd31 commit 6846649
Show file tree
Hide file tree
Showing 203 changed files with 873 additions and 824 deletions.
16 changes: 16 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ aliases:
name: Write artifactory settings to file
command: |
echo "$ARTIFACTORY_SETTINGS" | base64 --decode > .circleci/settings.xml
- &install-jdk21
name: Install jdk21
command: |
wget https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.tar.gz
tar -xvf jdk-21_linux-x64_bin.tar.gz
cd jdk-21.0.2
sudo mkdir -p /usr/local/jdk-21
sudo mv * /usr/local/jdk-21
export JAVA_HOME=/usr/local/jdk-21
export PATH=$JAVA_HOME/bin:$PATH
echo 'export JAVA_HOME=/usr/local/jdk-21' >> ~/.bashrc
echo 'export PATH=$JAVA_HOME/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
java --version
echo $JAVA_HOME
- &tag-git-version
name: Tag git commit with build version and push to github
command: |
Expand Down Expand Up @@ -58,6 +73,7 @@ jobs:
MAVEN_OPTS: -Xmx5G
steps:
- checkout
- run: *install-jdk21
- restore_cache:
key: dep-cache-{{ checksum "pom.xml" }}
- run: *jfrog-settings
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:17.0.9_9-jdk-jammy
FROM eclipse-temurin:21.0.2_13-jdk-jammy
WORKDIR /deployments
COPY target/tiamat-*-SNAPSHOT.jar tiamat.jar
RUN addgroup appuser && adduser --disabled-password appuser --ingroup appuser
Expand Down
4 changes: 1 addition & 3 deletions helm/tiamat/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ data:
publicationDeliveryUnmarshaller.validateAgainstSchema=true
netex.import.enabled.types=MERGE
changelog.publish.enabled=true
spring.activemq.broker-url=tcp://activemq.default:61616?jms.redeliveryPolicy.maximumRedeliveries=0
netex.id.valid.prefix.list={TopographicPlace:{'KVE','WOF','OSM','ENT','LAN'},TariffZone:{'*'},FareZone:{'*'},GroupOfTariffZones:{'*'}}
netex.profile.version=1.14:NO-NeTEx-stops:1.5
Expand All @@ -24,8 +23,7 @@ data:
blobstore.gcs.project.id={{.Values.configMap.blobstoreProjectId}}
# Database properties
spring.jpa.properties.javax.persistence.query.timeout=30000
spring.jpa.properties.hibernate.dialect=org.hibernate.spatial.dialect.postgis.PostgisDialect
spring.jpa.properties.jakarta.persistence.query.timeout=30000
spring.jpa.properties.hibernate.cache.region.factory_class=com.hazelcast.hibernate.HazelcastCacheRegionFactory
spring.jpa.properties.hibernate.cache.use_second_level_cache=true
spring.jpa.properties.hibernate.cache.use_minimal_puts=true
Expand Down
67 changes: 28 additions & 39 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>org.entur.ror</groupId>
<artifactId>superpom</artifactId>
<version>1.68</version>
<version>2.10</version>
</parent>
<groupId>org.rutebanken</groupId>
<artifactId>tiamat</artifactId>
Expand Down Expand Up @@ -49,17 +49,19 @@
</scm>

<properties>
<java.version>17</java.version>
<spring-cloud-gcp.version>4.8.3</spring-cloud-gcp.version>
<java.version>21</java.version>
<spring-cloud-gcp.version>5.1.0</spring-cloud-gcp.version>
<geotools.version>30.2</geotools.version>
<orika-core.version>1.5.4</orika-core.version>
<graphql-java.version>20.2</graphql-java.version>
<hazelcast-hibernate53.version>5.1.0</hazelcast-hibernate53.version>
<hazelcast.version>5.2.4</hazelcast.version>
<swagger-jersey2.version>1.6.2</swagger-jersey2.version>
<netex-java-model.version>1.0.14</netex-java-model.version>
<entur.helpers.version>1.100</entur.helpers.version>
<swagger-jersey2.version>2.2.20</swagger-jersey2.version>
<netex-java-model.version>2.0.14</netex-java-model.version>
<entur.helpers.version>2.11</entur.helpers.version>
<jts-core.version>1.19.0</jts-core.version>
<groovy-all.version>4.0.17</groovy-all.version>
<rest-assured.version>5.4.0</rest-assured.version>
<argLine/>

<xercesImpl.version>2.12.2</xercesImpl.version>
Expand Down Expand Up @@ -90,15 +92,9 @@
</dependency>

<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jersey2-jaxrs</artifactId>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-jaxrs2-jakarta</artifactId>
<version>${swagger-jersey2.version}</version>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down Expand Up @@ -131,8 +127,8 @@
<artifactId>jaxb-xjc</artifactId>
</dependency>
<dependency>
<groupId>javax.jms</groupId>
<artifactId>javax.jms-api</artifactId>
<groupId>jakarta.jms</groupId>
<artifactId>jakarta.jms-api</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
Expand Down Expand Up @@ -254,6 +250,11 @@
</exclusions>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-activemq</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
Expand All @@ -276,20 +277,15 @@
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-spatial</artifactId>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
</dependency>

<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
Expand Down Expand Up @@ -357,6 +353,14 @@
</exclusions>
</dependency>

<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>${groovy-all.version}</version>
<type>pom</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
Expand All @@ -367,6 +371,7 @@
</exclusion>
</exclusions>
<scope>test</scope>
<version>${rest-assured.version}</version>
</dependency>

<dependency>
Expand All @@ -389,22 +394,6 @@
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
</dependency>

<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-client</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-kahadb-store</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.CorsConfigurationSource;
Expand Down Expand Up @@ -58,7 +59,7 @@ CorsConfigurationSource corsConfigurationSource() {
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
logger.info("Configuring HttpSecurity");
http.cors(withDefaults())
.csrf().disable()
.csrf(AbstractHttpConfigurer::disable)
.authorizeHttpRequests()
.anyRequest().permitAll()
.and()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Licensed under the EUPL, Version 1.2 or – as soon they will be approved by
* the European Commission - subsequent versions of the EUPL (the "Licence");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* https://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/

package org.rutebanken.tiamat.changelog;

import org.rutebanken.tiamat.model.EntityInVersionStructure;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@Component
@Transactional
@Profile("test")
public class EntityChangedEventLocalPublisher extends EntityChangedEventPublisher implements EntityChangedListener {
public static final Logger logger = LoggerFactory.getLogger(EntityChangedEventLocalPublisher.class);


@Value("${changelog.queue.name:IrkallaChangelogQueue}")
private String queueName;

@Value("${changelog.publish.enabled:true}")
private boolean publish;

@Override
public void onChange(EntityInVersionStructure entity) {
if (publish && isLoggedEntity(entity)) {
logger.info("Sending entity changed event to queue: " + queueName + " for entity: " + entity.getId());
}
}

@Override
public void onDelete(EntityInVersionStructure entity) {
if (publish && isLoggedEntity(entity)) {
logger.info("Sending entity deleted event to queue: " + queueName + " for entity: " + entity.getId());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@

package org.rutebanken.tiamat.config;

import jakarta.persistence.EntityManagerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.orm.jpa.JpaTransactionManager;

import javax.persistence.EntityManagerFactory;

/**
* Configure a chained transaction manager for best effort multi resource transactions (db + jms).
* <p>
Expand Down
Loading

0 comments on commit 6846649

Please sign in to comment.