This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Date; | |
import javax.naming.InitialContext; | |
import jakarta.enterprise.context.RequestScoped; | |
import jakarta.inject.Named; | |
import jakarta.mail.Message; | |
import jakarta.mail.Session; | |
import jakarta.mail.Transport; | |
import jakarta.mail.internet.InternetAddress; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Steps: | |
1. download and unpack JetBrains Runtime JVM ([Java 21](https://github.com/JetBrains/JetBrainsRuntime/releases?q=%22Release+21.%22&expanded=false), [Java 17](https://github.com/JetBrains/JetBrainsRuntime/releases?q=%22Release+17.%22&expanded=false)), appropriated to your OS (vanilla JBR is enougth). | |
2. download [latest HotswapAgent](https://github.com/HotswapProjects/HotswapAgent/releases) and copy to GLASSFISH_HOME/glassfish/domains/DOMAIN_NAME/lib/ext | |
3. in Eclipse IDE: | |
3.1. add JetBrains Runtime JVM into "Installed JREs" list | |
3.2. set JetBrains Runtime as JVM for GlassFish Server | |
3.3. Add VM arguments "-XX:+AllowEnhancedClassRedefinition -XX:HotswapAgent=external -javaagent:GLASSFISH_HOME/glassfish/domains/DOMAIN_NAME/lib/ext/hotswap-agent-VERSION.jar=autoHotswap=true" to GlassFish launch configuration properties |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Locale; | |
import java.text.NumberFormat; | |
import org.aspectj.lang.ProceedingJoinPoint; | |
import org.aspectj.lang.annotation.Around; | |
import org.aspectj.lang.annotation.Aspect; | |
@Aspect | |
public class LoggingAspect { | |
@Around("execution(* *(..))") | |
public Object around(ProceedingJoinPoint joinPoint) throws Throwable { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>io.github.git-commit-id</groupId> | |
<artifactId>git-commit-id-maven-plugin</artifactId> | |
<version>5.0.0</version> | |
<executions> | |
<execution> | |
<id>add-git-info</id> | |
<phase>process-sources</phase> | |
<goals> | |
<goal>revision</goal> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Creating X.509 Certificate from existed GPG | |
gpg -k --with-keygrip | |
gpgsm --gen-key > x.pem | |
Please select what kind of key you want: | |
(1) RSA | |
(2) Existing key | |
(3) Existing key from card | |
2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In case of Wildfly 22 helps adding those dependencies in pom.xml: | |
... | |
<dependency> | |
<groupId>javax</groupId> | |
<artifactId>javaee-api</artifactId> <!-- or javaee-web-api --> | |
<version>8.0.1</version> | |
<scope>provided</scope> | |
</dependency> | |
<dependency> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM adoptopenjdk/openjdk11:jre-11.0.11_9-alpine as intermediate | |
# Minimize JRE distrib | |
RUN rm -rf /opt/java/openjdk/ | |
COPY --from=buildcontainer /custom-jre/ /opt/java/openjdk/ | |
# Copy without layers info | |
FROM alpine:3.13 | |
COPY --from=intermediate / / | |
ENV JAVA_HOME=/opt/java/openjdk \ | |
PATH="/opt/java/openjdk/bin:$PATH" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-assembly-plugin</artifactId> | |
<version>3.3.0</version> | |
<configuration> | |
<descriptorRefs> | |
<descriptorRef>jar-with-dependencies</descriptorRef> | |
</descriptorRefs> | |
</configuration> | |
<executions> |