diff --git a/build.gradle b/build.gradle index 853a9019a6..46e4e14645 100644 --- a/build.gradle +++ b/build.gradle @@ -35,6 +35,12 @@ group = 'org.neo4j.procedure' version = '3.2.0.4' archivesBaseName = 'apoc' +jar { + manifest { + attributes 'Implementation-Version': version + } +} + description = """neo4j-apoc-procedures""" ext { diff --git a/readme.adoc b/readme.adoc index 5ee6075977..3764aa1668 100644 --- a/readme.adoc +++ b/readme.adoc @@ -98,6 +98,14 @@ Any version to be released after 1.1.0 will use a different, consistent versioni |=== // end::version-matrix[] +=== Get APOC Version + +To know your current `apoc` version you can use the *Function* : + +[source,cypher] +---- +RETURN apoc.version() +---- === using APOC with Neo4j Docker image diff --git a/src/main/java/apoc/version/Version.java b/src/main/java/apoc/version/Version.java new file mode 100644 index 0000000000..1589bae4d4 --- /dev/null +++ b/src/main/java/apoc/version/Version.java @@ -0,0 +1,18 @@ +package apoc.version; + +import org.neo4j.procedure.Description; +import org.neo4j.procedure.UserFunction; + +/** + * @author AgileLARUS + * @since 24-07-17 + */ + +public class Version { + + @UserFunction("apoc.version") + @Description("RETURN apoc.version() | return the current APOC installed version") + public String version() { + return Version.class.getPackage().getImplementationVersion(); + } +}