[DEV] add email properties
This commit is contained in:
parent
f394254f38
commit
808784889b
@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry including="**/*.java" kind="src" output="out/maven/classes" path="src">
|
||||
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="out/maven/test-classes" path="test/src">
|
||||
<classpathentry kind="src" output="target/test-classes" path="test/src">
|
||||
<attributes>
|
||||
<attribute name="test" value="true"/>
|
||||
<attribute name="optional" value="true"/>
|
||||
@ -18,7 +18,7 @@
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="out/maven/test-classes" path="test/resources">
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="test/resources">
|
||||
<attributes>
|
||||
<attribute name="test" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
@ -30,5 +30,5 @@
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="out/maven/classes"/>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
|
15
pom.xml
15
pom.xml
@ -160,7 +160,18 @@
|
||||
<version>5.10.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.revelc.code.formatter</groupId>
|
||||
<artifactId>formatter-maven-plugin</artifactId>
|
||||
<version>2.23.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<version>3.3.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<sourceDirectory>src</sourceDirectory>
|
||||
<testSourceDirectory>test/src</testSourceDirectory>
|
||||
@ -241,7 +252,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<version>3.3.1</version>
|
||||
<configuration>
|
||||
<configLocation>CheckStyle.xml</configLocation>
|
||||
<consoleOutput>true</consoleOutput>
|
||||
@ -253,7 +264,7 @@
|
||||
<plugin>
|
||||
<groupId>net.revelc.code.formatter</groupId>
|
||||
<artifactId>formatter-maven-plugin</artifactId>
|
||||
<version>2.12.2</version>
|
||||
<version>2.23.0</version>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
<lineEnding>LF</lineEnding>
|
||||
|
@ -52,7 +52,7 @@ public class DBEntry implements Closeable {
|
||||
try {
|
||||
this.connection = DriverManager.getConnection(this.config.getUrl(true), this.config.getLogin(), this.config.getPassword());
|
||||
} catch (final SQLException ex) {
|
||||
throw new IOException("Connection db fail: " + ex.getMessage());
|
||||
throw new IOException("Connection db fail: " + ex.getMessage() + " On URL: " + this.config.getUrl(true));
|
||||
}
|
||||
|
||||
}
|
||||
@ -61,7 +61,7 @@ public class DBEntry implements Closeable {
|
||||
try {
|
||||
this.connection = DriverManager.getConnection(this.config.getUrl(), this.config.getLogin(), this.config.getPassword());
|
||||
} catch (final SQLException ex) {
|
||||
throw new IOException("Connection db fail: " + ex.getMessage());
|
||||
throw new IOException("Connection db fail: " + ex.getMessage() + " On URL: " + this.config.getUrl(true));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -14,6 +14,9 @@ public class ConfigBaseVariable {
|
||||
static public String ssoAdress;
|
||||
static public String ssoToken;
|
||||
static public String testMode;
|
||||
static public String eMailFrom;
|
||||
static public String eMailLogin;
|
||||
static public String eMailPassword;
|
||||
|
||||
// For test only
|
||||
public static void clearAllValue() {
|
||||
@ -30,6 +33,9 @@ public class ConfigBaseVariable {
|
||||
ssoAdress = System.getenv("SSO_ADDRESS");
|
||||
ssoToken = System.getenv("SSO_TOKEN");
|
||||
testMode = System.getenv("TEST_MODE");
|
||||
eMailFrom = System.getenv("EMAIL_FROM");
|
||||
eMailLogin = System.getenv("EMAIL_LOGIN");
|
||||
eMailPassword = System.getenv("EMAIL_PASSWORD");
|
||||
}
|
||||
|
||||
static {
|
||||
@ -120,4 +126,15 @@ public class ConfigBaseVariable {
|
||||
}
|
||||
return Boolean.parseBoolean(testMode);
|
||||
}
|
||||
|
||||
public record EMailConfig(String from, String login, String password) {
|
||||
};
|
||||
|
||||
public static EMailConfig getEMailConfig() {
|
||||
if (eMailFrom == null || eMailLogin == null || eMailPassword == null) {
|
||||
return null;
|
||||
}
|
||||
return new EMailConfig(eMailFrom, eMailLogin, eMailPassword);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,5 +23,5 @@ function __run() #(step, name, cmd)
|
||||
fi
|
||||
}
|
||||
|
||||
__run "1/1" "Check JAVA code format" "mvn formatter:verify"
|
||||
__run "1/1" "Check JAVA code format" "mvn formatter:validate"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user