diff --git a/pom.xml b/pom.xml
index 29f5bec..c84f1f6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,6 +35,12 @@
4.3.3
+
+ org.apache.maven
+ maven-artifact
+ 3.2.3
+
+
diff --git a/src/main/java/eu/over9000/skadi/channel/ChannelManager.java b/src/main/java/eu/over9000/skadi/channel/ChannelManager.java
index e502cb6..5d09bb8 100644
--- a/src/main/java/eu/over9000/skadi/channel/ChannelManager.java
+++ b/src/main/java/eu/over9000/skadi/channel/ChannelManager.java
@@ -52,7 +52,6 @@ private ChannelManager() {
}
public void addListener(final ChannelEventListener listener) {
- SkadiLogging.log("added channel listener: " + listener.getListenerName());
this.listeners.add(listener);
}
diff --git a/src/main/java/eu/over9000/skadi/util/SkadiVersionChecker.java b/src/main/java/eu/over9000/skadi/util/SkadiVersionChecker.java
index 9ae01e8..2c16749 100644
--- a/src/main/java/eu/over9000/skadi/util/SkadiVersionChecker.java
+++ b/src/main/java/eu/over9000/skadi/util/SkadiVersionChecker.java
@@ -34,6 +34,8 @@
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
+import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
+
import eu.over9000.skadi.gui.SkadiGUI;
import eu.over9000.skadi.logging.SkadiLogging;
@@ -52,19 +54,25 @@ public static void checkVersion() {
@Override
public void run() {
- final String localVersion = this.getClass().getPackage().getImplementationVersion();
+ final String localVersionString = this.getClass().getPackage().getImplementationVersion();
- if (localVersion == null) {
+ if (localVersionString == null) {
SkadiLogging.log("could not find local Version, will skip version check");
return;
}
- SkadiLogging.log("starting " + localVersion);
+ SkadiLogging.log("starting " + localVersionString);
final String remoteVersion = SkadiVersionRetriever.getLatestVersion();
- if (!remoteVersion.equals(localVersion)) {
-
+ final String currentVersionString = SkadiVersionRetriever.getLatestVersion();
+
+ final DefaultArtifactVersion currentVersion = new DefaultArtifactVersion(currentVersionString);
+ final DefaultArtifactVersion localVersion = new DefaultArtifactVersion(localVersionString);
+
+ final int result = currentVersion.compareTo(localVersion);
+
+ if (result > 0) { // newer version available
final String updateMsg = "There is a newer version (" + remoteVersion
+ ") of Skadi available. You can download it from: ";
SkadiLogging.log(updateMsg + SkadiVersionChecker.SKADI_RELEASES_URL);
@@ -97,12 +105,15 @@ public void mouseClicked(final MouseEvent event) {
}
});
- } else {
+
+ } else if (result == 0) { // latest release
SkadiLogging.log("This is the latest version.");
+
+ } else { // newer than latest release
+ SkadiLogging.log("This version is newer than the lastest public release version "
+ + currentVersionString + ", use with care");
}
-
}
}).start();
}
-
}