Relocate MySQL connector and fix migrations
This commit is contained in:
parent
0a418e886a
commit
31564d8284
@ -1,5 +1,5 @@
|
|||||||
<!-- AUTO-GENERATED FILE! Do not edit this directly -->
|
<!-- AUTO-GENERATED FILE! Do not edit this directly -->
|
||||||
<!-- File auto-generated on Sat Aug 21 23:12:31 CEST 2021. See docs/config/config.tpl.md -->
|
<!-- File auto-generated on Sun Nov 28 16:47:07 CET 2021. See docs/config/config.tpl.md -->
|
||||||
|
|
||||||
## AuthMe Configuration
|
## AuthMe Configuration
|
||||||
The first time you run AuthMe it will create a config.yml file in the plugins/AuthMe folder,
|
The first time you run AuthMe it will create a config.yml file in the plugins/AuthMe folder,
|
||||||
@ -30,9 +30,9 @@ DataSource:
|
|||||||
mySQLPassword: '12345'
|
mySQLPassword: '12345'
|
||||||
# Driver Name of the MySQL database.
|
# Driver Name of the MySQL database.
|
||||||
# Built-in drivers:
|
# Built-in drivers:
|
||||||
# MySQL: 'com.mysql.cj.jdbc.Driver'
|
# MySQL: 'fr.xephi.authme.libs.com.mysql.cj.jdbc.Driver'
|
||||||
# MariaDB: 'org.mariadb.jdbc.Driver'
|
# MariaDB: 'fr.xephi.authme.libs.org.mariadb.jdbc.Driver'
|
||||||
mySQLDriverClassName: com.mysql.cj.jdbc.Driver
|
mySQLDriverClassName: fr.xephi.authme.libs.com.mysql.cj.jdbc.Driver
|
||||||
# Database Name, use with converters or as SQLITE database name
|
# Database Name, use with converters or as SQLITE database name
|
||||||
mySQLDatabase: authme
|
mySQLDatabase: authme
|
||||||
# Table of the database
|
# Table of the database
|
||||||
@ -590,4 +590,4 @@ To change settings on a running server, save your changes to config.yml and use
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
This page was automatically generated on the [AuthMe/AuthMeReloaded repository](https://github.com/AuthMe/AuthMeReloaded/tree/master/docs/) on Sat Aug 21 23:12:31 CEST 2021
|
This page was automatically generated on the [AuthMe/AuthMeReloaded repository](https://github.com/AuthMe/AuthMeReloaded/tree/master/docs/) on Sun Nov 28 16:47:07 CET 2021
|
||||||
|
|||||||
4
pom.xml
4
pom.xml
@ -384,6 +384,10 @@
|
|||||||
<pattern>org.mariadb.jdbc</pattern>
|
<pattern>org.mariadb.jdbc</pattern>
|
||||||
<shadedPattern>fr.xephi.authme.libs.org.mariadb.jdbc</shadedPattern>
|
<shadedPattern>fr.xephi.authme.libs.org.mariadb.jdbc</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
|
<relocation>
|
||||||
|
<pattern>com.mysql</pattern>
|
||||||
|
<shadedPattern>fr.xephi.authme.libs.com.mysql</shadedPattern>
|
||||||
|
</relocation>
|
||||||
</relocations>
|
</relocations>
|
||||||
|
|
||||||
<filters>
|
<filters>
|
||||||
|
|||||||
@ -104,8 +104,8 @@ public class MySQL extends AbstractSqlDataSource {
|
|||||||
try {
|
try {
|
||||||
Class.forName(this.className);
|
Class.forName(this.className);
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
logger.info("Driver class '" + this.className + "' not found! Falling back to legacy MySQL driver (com.mysql.jdbc.Driver)");
|
this.className = DatabaseSettings.MYSQL_DRIVER_CLASS_NAME.getDefaultValue();
|
||||||
this.className = "com.mysql.jdbc.Driver";
|
logger.info("Driver class '" + this.className + "' not found! Falling back to the built-in MySQL driver (" + this.className + ")");
|
||||||
}
|
}
|
||||||
this.database = settings.getProperty(DatabaseSettings.MYSQL_DATABASE);
|
this.database = settings.getProperty(DatabaseSettings.MYSQL_DATABASE);
|
||||||
this.tableName = settings.getProperty(DatabaseSettings.MYSQL_TABLE);
|
this.tableName = settings.getProperty(DatabaseSettings.MYSQL_TABLE);
|
||||||
|
|||||||
@ -65,8 +65,9 @@ public class SettingsMigrationService extends PlainMigrationService {
|
|||||||
configurationData.setValue(ALLOWED_NICKNAME_CHARACTERS, "[a-zA-Z0-9_]*");
|
configurationData.setValue(ALLOWED_NICKNAME_CHARACTERS, "[a-zA-Z0-9_]*");
|
||||||
changes = true;
|
changes = true;
|
||||||
}
|
}
|
||||||
if ("com.mysql.jdbc.Driver".equals(reader.getString(DatabaseSettings.MYSQL_DRIVER_CLASS_NAME.getPath()))) {
|
String driverClass = reader.getString(DatabaseSettings.MYSQL_DRIVER_CLASS_NAME.getPath());
|
||||||
configurationData.setValue(DatabaseSettings.MYSQL_DRIVER_CLASS_NAME, "com.mysql.cj.jdbc.Driver");
|
if ("com.mysql.jdbc.Driver".equals(driverClass) || "com.mysql.cj.jdbc.Driver".equals(driverClass)) {
|
||||||
|
configurationData.setValue(DatabaseSettings.MYSQL_DRIVER_CLASS_NAME, DatabaseSettings.MYSQL_DRIVER_CLASS_NAME.getDefaultValue());
|
||||||
changes = true;
|
changes = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -47,10 +47,10 @@ public final class DatabaseSettings implements SettingsHolder {
|
|||||||
|
|
||||||
@Comment({"Driver Name of the MySQL database.",
|
@Comment({"Driver Name of the MySQL database.",
|
||||||
"Built-in drivers:",
|
"Built-in drivers:",
|
||||||
" MySQL: 'com.mysql.cj.jdbc.Driver'",
|
" MySQL: 'fr.xephi.authme.libs.com.mysql.cj.jdbc.Driver'",
|
||||||
" MariaDB: 'org.mariadb.jdbc.Driver'"})
|
" MariaDB: 'fr.xephi.authme.libs.org.mariadb.jdbc.Driver'"})
|
||||||
public static final Property<String> MYSQL_DRIVER_CLASS_NAME =
|
public static final Property<String> MYSQL_DRIVER_CLASS_NAME =
|
||||||
newProperty("DataSource.mySQLDriverClassName", "com.mysql.cj.jdbc.Driver");
|
newProperty("DataSource.mySQLDriverClassName", "fr.xephi.authme.libs.com.mysql.cj.jdbc.Driver");
|
||||||
|
|
||||||
@Comment("Database Name, use with converters or as SQLITE database name")
|
@Comment("Database Name, use with converters or as SQLITE database name")
|
||||||
public static final Property<String> MYSQL_DATABASE =
|
public static final Property<String> MYSQL_DATABASE =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user