diff options
author | Jim Hahn <jrh3@att.com> | 2021-02-09 11:01:43 -0500 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-02-09 15:45:13 -0500 |
commit | 6127b4d50fccaa2e59f9e40910861260eb695c15 (patch) | |
tree | 0bd2ee574316e82db5538332bb7bd87f4b479a10 /feature-session-persistence | |
parent | 208be1c545895cf61bc38fbc7bc5e9e45d085016 (diff) |
Upgrade dependencies
Changes to eclipselink are incompatible with javax-persistence-api so
removed the latter.
Also added target-database property.
Also replaced string constants with eclipselink constants.
Per review comments, moved target-database values to property files.
Issue-ID: POLICY-3005
Change-Id: I043203a952d54406a5996c1e8b5ba8936bf558c0
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'feature-session-persistence')
4 files changed, 24 insertions, 10 deletions
diff --git a/feature-session-persistence/pom.xml b/feature-session-persistence/pom.xml index 765d85b7..a1931451 100644 --- a/feature-session-persistence/pom.xml +++ b/feature-session-persistence/pom.xml @@ -2,7 +2,7 @@ ============LICENSE_START======================================================= ONAP Policy Engine - Drools PDP ================================================================================ - Copyright (C) 2017-2018, 2020 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2017-2018, 2020-2021 AT&T Intellectual Property. All rights reserved. Modifications Copyright (C) 2020 Nordix Foundation. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); @@ -131,6 +131,16 @@ <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <scope>provided</scope> + <!-- + Exclude this because it's incompatible with eclipselink, which already + includes the same classes. + --> + <exclusions> + <exclusion> + <groupId>javax.persistence</groupId> + <artifactId>javax.persistence-api</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.hibernate.common</groupId> diff --git a/feature-session-persistence/src/main/feature/config/feature-session-persistence.properties b/feature-session-persistence/src/main/feature/config/feature-session-persistence.properties index a32ce229..ae9ce453 100644 --- a/feature-session-persistence/src/main/feature/config/feature-session-persistence.properties +++ b/feature-session-persistence/src/main/feature/config/feature-session-persistence.properties @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # feature-session-persistence # ================================================================================ -# Copyright (C) 2017, 2019 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017, 2019, 2021 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ # ============LICENSE_END========================================================= ### +eclipselink.target-database=MySQL javax.persistence.jdbc.driver= org.mariadb.jdbc.Driver javax.persistence.jdbc.url=jdbc:mariadb://${env:SQL_HOST}:3306/sessionpersistence javax.persistence.jdbc.user=${env:SQL_USER} diff --git a/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsPersistenceProperties.java b/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsPersistenceProperties.java index 4700e8ae..93440dad 100644 --- a/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsPersistenceProperties.java +++ b/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsPersistenceProperties.java @@ -2,14 +2,14 @@ * ============LICENSE_START======================================================= * feature-session-persistence * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018, 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,14 +20,16 @@ package org.onap.policy.drools.persistence; +import org.eclipse.persistence.config.PersistenceUnitProperties; + public class DroolsPersistenceProperties { /* * feature-session-persistence.properties parameter key values */ - public static final String DB_DRIVER = "javax.persistence.jdbc.driver"; - public static final String DB_URL = "javax.persistence.jdbc.url"; - public static final String DB_USER = "javax.persistence.jdbc.user"; - public static final String DB_PWD = "javax.persistence.jdbc.password"; + public static final String DB_DRIVER = PersistenceUnitProperties.JDBC_DRIVER; + public static final String DB_URL = PersistenceUnitProperties.JDBC_URL; + public static final String DB_USER = PersistenceUnitProperties.JDBC_USER; + public static final String DB_PWD = PersistenceUnitProperties.JDBC_PASSWORD; public static final String DB_SESSIONINFO_TIMEOUT = "persistence.sessioninfo.timeout"; public static final String JTA_OBJECTSTORE_DIR = "persistence.objectstore.dir"; diff --git a/feature-session-persistence/src/test/resources/feature-session-persistence.properties b/feature-session-persistence/src/test/resources/feature-session-persistence.properties index a1e9cc43..1c662f95 100644 --- a/feature-session-persistence/src/test/resources/feature-session-persistence.properties +++ b/feature-session-persistence/src/test/resources/feature-session-persistence.properties @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # feature-session-persistence # ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017, 2021 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ # ============LICENSE_END========================================================= ### +eclipselink.target-database=Auto javax.persistence.jdbc.driver=org.h2.Driver javax.persistence.jdbc.url=jdbc:h2:mem:TestPersistenceFeature javax.persistence.jdbc.user=testuser |