Skip to content

Commit

Permalink
removal of mysql/mariadb from code, scripts, POMs, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Feb 8, 2022
1 parent dcdc09e commit d7d111f
Show file tree
Hide file tree
Showing 25 changed files with 46 additions and 531 deletions.
16 changes: 3 additions & 13 deletions dist/src/main/bin/midpoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Portions Copyright (C) 2017-2020 Evolveum and contributors
# Portions Copyright (C) 2017-2022 Evolveum and contributors
#
# This work is dual-licensed under the Apache License 2.0
# and European Union Public License. See LICENSE file for details.
Expand Down Expand Up @@ -167,7 +167,7 @@ if [ "${1}" = "init-native" ] ; then
tail -f /dev/null
fi
exit 0
fi
fi

mkdir -p "${MIDPOINT_HOME}/log"

Expand Down Expand Up @@ -214,7 +214,7 @@ fi

###### Backward compatibility for ENV variables ####

if [ "${MP_NO_ENV_COMPAT:-}" != "1" ] ; then
if [ "${MP_NO_ENV_COMPAT:-}" != "1" ] ; then
[ "${REPO_PORT:-}" != "" ] && db_port=${REPO_PORT}
if [ "${REPO_DATABASE_TYPE:-}" != "" ]
then
Expand All @@ -226,16 +226,6 @@ if [ "${MP_NO_ENV_COMPAT:-}" != "1" ] ; then
db_prefix="jdbc:h2:tcp://"
db_path="/${REPO_DATABASE:-midpoint}"
;;
mariadb)
[ "${db_port:-}" == "" ] && db_port=3306
db_prefix="jdbc:mariadb://"
db_path="/${REPO_DATABASE:-midpoint}?characterEncoding=utf8"
;;
mysql)
[ "${db_port:-}" == "" ] && db_port=3306
db_prefix="jdbc:mysql://"
db_path="/${REPO_DATABASE:-midpoint}?characterEncoding=utf8"
;;
oracle)
[ "${db_port:-}" == "" ] && db_port=1521
db_prefix="jdbc:oracle:thin:@"
Expand Down
17 changes: 1 addition & 16 deletions gui/admin-gui/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!--
~ Copyright (C) 2010-2021 Evolveum and contributors
~ Copyright (C) 2010-2022 Evolveum and contributors
~
~ This work is dual-licensed under the Apache License 2.0
~ and European Union Public License. See LICENSE file for details.
Expand Down Expand Up @@ -230,19 +230,9 @@
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<scope>runtime</scope>
</dependency>
<!--
Following drivers are excluded in repackaging, we don't want to distribute it (or can't).
-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
Expand Down Expand Up @@ -847,10 +837,6 @@
Also, exclude does NOT exclude transitive dependencies (as of Boot 2.3.3). How crazy is that?!
See truezip-maven-plugin plugin lower.
<excludes>
<exclude>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</exclude>
<exclude>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
Expand Down Expand Up @@ -907,7 +893,6 @@
<include>simplefan-*.jar</include>
<include>ons-*.jar</include>
<include>mssql-jdbc-*.jar</include>
<include>mysql-connector-java-*.jar</include>
</includes>
</fileset>
</configuration>
Expand Down
17 changes: 1 addition & 16 deletions gui/midpoint-jar/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (C) 2010-2021 Evolveum and contributors
~ Copyright (C) 2010-2022 Evolveum and contributors
~
~ This work is dual-licensed under the Apache License 2.0
~ and European Union Public License. See LICENSE file for details.
Expand Down Expand Up @@ -55,22 +55,12 @@
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<scope>runtime</scope>
</dependency>
<!--
Following drivers are excluded in repackaging, we don't want to distribute it (or can't).
TODO: in admin-gui they are provided, because it's handy for developer
but perhaps we can just delete it here and recheck whether they are packaged.
See repackaging "exclusions" and truezip-maven-plugin lower.
-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
Expand Down Expand Up @@ -112,10 +102,6 @@
Exclude does NOT exclude transitive dependencies (as of Boot 2.3.3). How crazy is that?!
See truezip-maven-plugin plugin lower.
<excludes>
<exclude>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</exclude>
<exclude>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
Expand Down Expand Up @@ -160,7 +146,6 @@
<include>simplefan-*.jar</include>
<include>ons-*.jar</include>
<include>mssql-jdbc-*.jar</include>
<include>mysql-connector-java-*.jar</include>
</includes>
</fileset>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (C) 2010-2021 Evolveum and contributors
~ Copyright (C) 2010-2022 Evolveum and contributors
~
~ This work is dual-licensed under the Apache License 2.0
~ and European Union Public License. See LICENSE file for details.
Expand Down Expand Up @@ -19915,7 +19915,7 @@
<jaxb:typesafeEnumMember name="DEFAULT"/>
<xsd:documentation>
Uses the default method configured for the particular database.
For H2, MySQL/MariaDB the default is to emulate iteration via paging,
For H2 the default is to emulate iteration via paging,
for other databases it is traditional sequential read.
</xsd:documentation>
</xsd:appinfo>
Expand Down
9 changes: 1 addition & 8 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (C) 2010-2021 Evolveum and contributors
~ Copyright (C) 2010-2022 Evolveum and contributors
~
~ This work is dual-licensed under the Apache License 2.0
~ and European Union Public License. See LICENSE file for details.
Expand Down Expand Up @@ -250,7 +250,6 @@
<commons.csv.version>1.8</commons.csv.version>
<j2html.version>1.4.0</j2html.version>
<bouncycastle.version>1.69</bouncycastle.version>
<protobuf.version>3.17.3</protobuf.version>
<javax.persistence.version>2.2</javax.persistence.version>

<asciidoclet.version>1.5.6</asciidoclet.version>
Expand Down Expand Up @@ -1283,12 +1282,6 @@
</exclusion>
</exclusions>
</dependency>
<!-- used by both wro4j-extensions/com.github.sommeri:less4j and mysql driver -->
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>${protobuf.version}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
Expand Down
12 changes: 1 addition & 11 deletions repo/repo-sql-impl-test/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!--
~ Copyright (C) 2010-2021 Evolveum and contributors
~ Copyright (C) 2010-2022 Evolveum and contributors
~
~ This work is dual-licensed under the Apache License 2.0
~ and European Union Public License. See LICENSE file for details.
Expand Down Expand Up @@ -129,16 +129,6 @@
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
Expand Down
12 changes: 0 additions & 12 deletions repo/repo-sql-impl-test/sample-configurations/mysql.properties

This file was deleted.

89 changes: 0 additions & 89 deletions repo/repo-sql-impl-test/sql-procedures/mysql.sql

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
/*
* Copyright (c) 2010-2017 Evolveum and contributors
* Copyright (C) 2010-2022 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/

package com.evolveum.midpoint.repo.sql;

import com.evolveum.midpoint.repo.sql.util.*;
import com.evolveum.midpoint.tools.testng.AbstractUnitTest;
import com.evolveum.midpoint.util.ClassPathUtil;
import java.io.File;
import java.util.EnumSet;
import java.util.Set;

import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.hibernate.tool.schema.TargetType;
import org.testng.annotations.Test;

import java.io.File;
import java.util.EnumSet;
import java.util.Set;
import com.evolveum.midpoint.repo.sql.util.*;
import com.evolveum.midpoint.tools.testng.AbstractUnitTest;
import com.evolveum.midpoint.util.ClassPathUtil;

/**
* Created by Viliam Repan (lazyman).
Expand All @@ -30,7 +30,6 @@ public class SchemaTest extends AbstractUnitTest {
public void generateSchemas() {
createSQLSchema("./target/h2-schema.sql", H2Dialect.class.getName());
createSQLSchema("./target/sqlserver-schema.sql", UnicodeSQLServer2008Dialect.class.getName());
createSQLSchema("./target/mysql-schema.sql", MidPointMySQLDialect.class.getName());
createSQLSchema("./target/oracle-schema.sql", MidPointOracleDialect.class.getName());
createSQLSchema("./target/postgresql-schema.sql", MidPointPostgreSQLDialect.class.getName());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2021 Evolveum and contributors
* Copyright (C) 2010-2022 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
Expand All @@ -15,7 +15,6 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import com.evolveum.midpoint.repo.sql.util.MidPointMySQLDialect;
import com.evolveum.midpoint.repo.sql.util.MidPointOracleDialect;
import com.evolveum.midpoint.repo.sql.util.MidPointPostgreSQLDialect;
import com.evolveum.midpoint.repo.sql.util.UnicodeSQLServer2008Dialect;
Expand All @@ -26,10 +25,6 @@ public enum Database {
// Order of dialects is important, the first value is the default.
H2("org.h2.Driver",
H2Dialect.class.getName()),
MYSQL("com.mysql.cj.jdbc.Driver",
MidPointMySQLDialect.class.getName(),
org.hibernate.dialect.MySQLDialect.class.getName(),
org.hibernate.dialect.MySQLInnoDBDialect.class.getName()),
POSTGRESQL("org.postgresql.Driver",
MidPointPostgreSQLDialect.class.getName(),
org.hibernate.dialect.PostgreSQLDialect.class.getName(),
Expand All @@ -43,9 +38,7 @@ public enum Database {
org.hibernate.dialect.Oracle9Dialect.class.getName(),
org.hibernate.dialect.Oracle8iDialect.class.getName(),
org.hibernate.dialect.Oracle9iDialect.class.getName(),
org.hibernate.dialect.Oracle10gDialect.class.getName()),
MARIADB("org.mariadb.jdbc.Driver",
MidPointMySQLDialect.class.getName());
org.hibernate.dialect.Oracle10gDialect.class.getName());

@NotNull List<String> drivers;
@NotNull List<String> dialects;
Expand Down

0 comments on commit d7d111f

Please sign in to comment.