Gradle + JAX-RS + EJB + MAIL example
Rest service with async EBJ method for sending mails.
./gradlew clean wildfly-swarm-package
java -jar ./build/libs/gradle-mail-swarm.jar
By default, this will try to connect to an SMTP server at
localhost:25. You can override this any of three ways:
build.gradleand change the
smtp.*properties, then rebuild the swarm jar. This will embed the properties in the jar itself.
smtp.*properties to gradle when building the jar:
./gradlew clean wildfly-swarm-package -Dsmtp.host=fooThis will also embed the properties in the jar itself.
- Pass properties to the application at runtime:
java -Dsmtp.host=foo -jar ./build/libs/gradle-mail-swarm.jarThis will override the property that was embedded in the jar.