Created
October 29, 2012 17:52
-
-
Save juriad/3975208 to your computer and use it in GitHub Desktop.
verze v pluginu a patičce
This file contains 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
diff --git a/ceinstall/build.sh b/ceinstall/build.sh | |
index 12fa816..24cded9 100755 | |
--- a/ceinstall/build.sh | |
+++ b/ceinstall/build.sh | |
@@ -4,7 +4,7 @@ cd ../localization_sk/ && atlas-mvn clean package && cd ../ceinstall | |
atlas-mvn clean assembly:assembly | |
mkdir ceplugin | |
rm ceplugin/ce-* ceplugin/localization_cz-*.jar | |
-cp ../semanta/target/ce-2.1.6-SNAPSHOT.jar ceplugin/ | |
+cp ../semanta/target/ce-2.1.6.jar ceplugin/ | |
cp ../localization_cz/target/localization_cz-10.0.1.jar ceplugin/ | |
cp ../localization_sk/target/localization_sk-10.0.1.jar ceplugin/ | |
rm -f ce2*.zip | |
diff --git a/semanta/pom.xml b/semanta/pom.xml | |
index af41ad0..4d002a5 100644 | |
--- a/semanta/pom.xml | |
+++ b/semanta/pom.xml | |
@@ -6,10 +6,15 @@ | |
<groupId>cz.semanta</groupId> | |
<artifactId>ce</artifactId> | |
- <version>2.1.6-SNAPSHOT</version> | |
+ <version>2.1.6</version> | |
<name>ce - Company Encyclopedia by Semanta</name> | |
<packaging>atlassian-plugin</packaging> | |
+ | |
+ <scm> | |
+ <connection>scm:git:file://.</connection> | |
+ <tag>HEAD</tag> | |
+ </scm> | |
<organization> | |
<name>Semanta</name> | |
@@ -388,6 +393,29 @@ | |
<encoding>UTF-8</encoding> | |
</configuration> | |
</plugin> | |
+ <plugin> | |
+ <groupId>org.codehaus.mojo</groupId> | |
+ <artifactId>buildnumber-maven-plugin</artifactId> | |
+ <version>1.2</version> | |
+ <executions> | |
+ <execution> | |
+ <phase>validate</phase> | |
+ <goals> | |
+ <goal>create</goal> | |
+ </goals> | |
+ </execution> | |
+ </executions> | |
+ <configuration> | |
+ <doCheck>false</doCheck> | |
+ <doUpdate>false</doUpdate> | |
+ <format>${project.version},{0,date,yyyyMMdd-HHmmss},git-{1}</format> | |
+ <items> | |
+ <item>timestamp</item> | |
+ <item>scmVersion</item> | |
+ </items> | |
+ <shortRevisionLength>8</shortRevisionLength> | |
+ </configuration> | |
+ </plugin> | |
<plugin> | |
<groupId>com.atlassian.maven.plugins</groupId> | |
<artifactId>maven-confluence-plugin</artifactId> | |
diff --git a/semanta/src/main/java/cz/inexperts/biportal/BiportalThemeService.java b/semanta/src/main/java/cz/inexperts/biportal/BiportalThemeService.java | |
index 7673ce6..e9545cf 100644 | |
--- a/semanta/src/main/java/cz/inexperts/biportal/BiportalThemeService.java | |
+++ b/semanta/src/main/java/cz/inexperts/biportal/BiportalThemeService.java | |
@@ -49,6 +49,9 @@ public class BiportalThemeService { | |
private HelpString helpString = new HelpString(); | |
private CeTools ceTools = new CeTools(); | |
private Boolean isTree = false; | |
+ | |
+ private String version = null; | |
+ | |
/** | |
* i18n codes that have to be available to our javascript | |
*/ | |
@@ -502,6 +505,14 @@ public class BiportalThemeService { | |
} | |
return tt.getFooter(); | |
} | |
+ | |
+ public String getVersion() { | |
+ if(version == null) { | |
+ Tools t = Tools.getTools(); | |
+ version = t.getPlugin().getPluginInformation().getVersion(); | |
+ } | |
+ return version; | |
+ } | |
public CemenuType getMenu(String menuid) { | |
diff --git a/semanta/src/main/java/cz/semanta/inexutil/Tools.java b/semanta/src/main/java/cz/semanta/inexutil/Tools.java | |
index 5d771ad..094a9db 100644 | |
--- a/semanta/src/main/java/cz/semanta/inexutil/Tools.java | |
+++ b/semanta/src/main/java/cz/semanta/inexutil/Tools.java | |
@@ -31,6 +31,8 @@ import com.atlassian.confluence.user.*; | |
import com.atlassian.confluence.velocity.htmlsafe.HtmlFragment; | |
import com.atlassian.core.task.MultiQueueTaskManager; | |
import com.atlassian.event.EventManager; | |
+import com.atlassian.plugin.Plugin; | |
+import com.atlassian.plugin.PluginAccessor; | |
import com.atlassian.plugin.webresource.WebResourceManager; | |
import com.atlassian.renderer.RenderContext; | |
import com.atlassian.renderer.WikiStyleRenderer; | |
@@ -64,6 +66,7 @@ import static java.text.Normalizer.Form.NFD; | |
*/ | |
public final class Tools { | |
private static Logger statLog = Logger.getLogger(Tools.class); | |
+ private static final String CE_PLUGIN_NAME = "cz.semanta.ce"; | |
private static Tools tools; // the singleton of this class | |
private String context; // the context part of the web address | |
@@ -103,6 +106,7 @@ public final class Tools { | |
private MultiQueueTaskManager taskManager; | |
private UserDetailsManager userDetailsManager; | |
private PersonalInformationManager personalInformationManager; | |
+ private PluginAccessor pluginAccessor; | |
public void setUserDetailsManager(UserDetailsManager userDetailsManager) { | |
@@ -1127,4 +1131,16 @@ public final class Tools { | |
pi.setEmail(email); | |
} | |
+ public PluginAccessor getPluginAccessor() { | |
+ return pluginAccessor; | |
+ } | |
+ | |
+ public void setPluginAccessor(PluginAccessor pluginAccessor) { | |
+ this.pluginAccessor = pluginAccessor; | |
+ } | |
+ | |
+ public Plugin getPlugin() { | |
+ return getPluginAccessor().getPlugin(CE_PLUGIN_NAME); | |
+ } | |
+ | |
} | |
diff --git a/semanta/src/main/resources/atlassian-plugin.xml b/semanta/src/main/resources/atlassian-plugin.xml | |
index dd3d132..4f1a8ea 100644 | |
--- a/semanta/src/main/resources/atlassian-plugin.xml | |
+++ b/semanta/src/main/resources/atlassian-plugin.xml | |
@@ -2,7 +2,7 @@ | |
<plugin-info> | |
<description>Semanta company encyclopedia plugin with Air interface.</description> | |
- <version>${project.version}</version> | |
+ <version>${buildNumber}</version> | |
<vendor name="${project.organization.name}" url="${project.organization.url}"/> | |
</plugin-info> | |
diff --git a/semanta/src/main/resources/dec/main.vmd b/semanta/src/main/resources/dec/main.vmd | |
index ad79989..299eebd 100644 | |
--- a/semanta/src/main/resources/dec/main.vmd | |
+++ b/semanta/src/main/resources/dec/main.vmd | |
@@ -299,6 +299,8 @@ | |
<span>Designed by <a href="http://semanta.cz/">Semanta</a> and powered by <a | |
href="http://atlassian.com">Atlassian</a></span>. | |
#end | |
+ #set($version=$themeService.getVersion()) | |
+ <span class="version">$!{version}</span> | |
</div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment