diff --git a/build.gradle b/build.gradle index a2413a44..cb7f9aa9 100644 --- a/build.gradle +++ b/build.gradle @@ -34,7 +34,7 @@ group = 'pl.touk' version = '1.4.0' mainClassName = 'pl.touk.sputnik.Main' -run { +run { // You can launch Sputnik having only build.gradle file in your repo and executing: // gradle run -Dexec.args="--conf example.properties --changeId 1234 --revisionId 4321" def arguments = System.getProperty("exec.args") @@ -149,6 +149,15 @@ artifacts { archives sourcesJar } +jar { + manifest { + attributes("Specification-Title": "Sputnik", + "Specification-Version": version, + "Implementation-Title": "Sputnik", + "Implementation-Version": scmVersion.rawVersion.version) + } +} + signing { required { gradle.taskGraph.hasTask("uploadArchives") } sign configurations.archives diff --git a/src/main/java/pl/touk/sputnik/Main.java b/src/main/java/pl/touk/sputnik/Main.java index 32f6202c..e6f55c59 100644 --- a/src/main/java/pl/touk/sputnik/Main.java +++ b/src/main/java/pl/touk/sputnik/Main.java @@ -4,13 +4,7 @@ import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.ParseException; import org.jetbrains.annotations.NotNull; - -import pl.touk.sputnik.configuration.CliOption; -import pl.touk.sputnik.configuration.CliWrapper; -import pl.touk.sputnik.configuration.Configuration; -import pl.touk.sputnik.configuration.ConfigurationHolder; -import pl.touk.sputnik.configuration.GeneralOption; -import pl.touk.sputnik.configuration.GeneralOptionNotSupportedException; +import pl.touk.sputnik.configuration.*; import pl.touk.sputnik.connector.ConnectorFacade; import pl.touk.sputnik.connector.ConnectorFacadeFactory; import pl.touk.sputnik.connector.ConnectorType; @@ -24,6 +18,7 @@ public final class Main { private Main() {} public static void main(String[] args) { + printWelcomeMessage(); CliWrapper cliWrapper = new CliWrapper(); CommandLine commandLine = null; try { @@ -62,4 +57,8 @@ private static void printUsage(@NotNull CliWrapper cliOptions) { helpFormatter.setWidth(WIDTH); helpFormatter.printHelp(SPUTNIK, cliOptions.getOptions(), true); } + + private static void printWelcomeMessage() { + System.out.println("Sputnik version " + Main.class.getPackage().getImplementationVersion()); + } }