diff --git a/pom.xml b/pom.xml
index f4cf07e..631fe24 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
io.github.ktestify
ktestify-parent
- 1.0.2
+ 1.0.3
@@ -56,7 +56,7 @@
io.github.ktestify
ktestify-core
- 1.0.3
+ 1.1.2
@@ -122,6 +122,31 @@
${project.build.finalName}
+
+ org.apache.maven.plugins
+ maven-resources-plugin
+
+
+ filter-plugin-version
+
+ copy-resources
+
+ process-resources
+
+ ${project.build.outputDirectory}
+
+
+ src/main/resources
+ true
+
+ **/plugin-version.properties
+
+
+
+
+
+
+
org.apache.maven.plugins
diff --git a/src/main/java/io/github/ktestify/notifications/NotificationsPlugin.java b/src/main/java/io/github/ktestify/notifications/NotificationsPlugin.java
index 93bbddf..af40347 100644
--- a/src/main/java/io/github/ktestify/notifications/NotificationsPlugin.java
+++ b/src/main/java/io/github/ktestify/notifications/NotificationsPlugin.java
@@ -18,6 +18,7 @@
import io.github.ktestify.notifications.config.NotificationsConfig;
import io.github.ktestify.plugin.KtestifyPlugin;
import io.github.ktestify.plugin.PluginContext;
+import io.github.ktestify.plugin.PluginVersionResolver;
import lombok.extern.slf4j.Slf4j;
/**
@@ -65,8 +66,9 @@
@Slf4j
public class NotificationsPlugin implements KtestifyPlugin {
+ private static final String PLUGIN_VERSION = PluginVersionResolver.resolve(NotificationsPlugin.class, "dev");
+
private static final String PLUGIN_ID = "notifications";
- private static final String VERSION = "1.0-SNAPSHOT";
@Override
public String getId() {
@@ -75,7 +77,7 @@ public String getId() {
@Override
public String getVersion() {
- return VERSION;
+ return PLUGIN_VERSION;
}
@Override
@@ -111,12 +113,12 @@ public String getGluePackage() {
*/
@Override
public void initialize(PluginContext context) {
- log.info("Initializing {} plugin v{}", getId(), getVersion());
+ log.info("Initializing plugin v{}", getVersion());
NotificationsConfig cfg = NotificationsConfig.from(context.getConfig().getRaw());
if (!cfg.isEnabled()) {
- log.info("[{}] Notifications disabled. Set KTESTIFY_NOTIFICATIONS_ENABLED=true to activate.", getId());
+ log.info("Notifications disabled. Set KTESTIFY_NOTIFICATIONS_ENABLED=true to activate.");
return;
}
@@ -124,15 +126,13 @@ public void initialize(PluginContext context) {
long groupCount = cfg.getGroups().size();
log.info(
- "[{}] Plugin initialized, {} channel(s) active, {} tag group(s) configured, on-failure-only={}.",
- getId(),
+ "Plugin initialized. Found {} channel(s) active, {} tag group(s) configured, on-failure-only={}.",
enabledChannels,
groupCount,
cfg.isOnFailureOnly());
cfg.getEnabledChannels()
- .forEach(ch -> log.info(
- "[{}] • channel: type={}, on-failure-only={}", getId(), ch.getType(), ch.isOnFailureOnly()));
+ .forEach(ch -> log.info(" channel: type={}, on-failure-only={}", ch.getType(), ch.isOnFailureOnly()));
}
/**
@@ -141,6 +141,6 @@ public void initialize(PluginContext context) {
*/
@Override
public void shutdown() {
- log.debug("[{}] Plugin shut down.", getId());
+ log.debug("Plugin shut down.");
}
}
diff --git a/src/main/resources/io/github/ktestify/notifications/plugin-version.properties b/src/main/resources/io/github/ktestify/notifications/plugin-version.properties
new file mode 100644
index 0000000..6ad3cbf
--- /dev/null
+++ b/src/main/resources/io/github/ktestify/notifications/plugin-version.properties
@@ -0,0 +1,2 @@
+plugin.version=${project.version}
+