diff --git a/cli/neo4jv4/pom.xml b/cli/neo4jv4/pom.xml index 312ce5fa70..e07179cc38 100644 --- a/cli/neo4jv4/pom.xml +++ b/cli/neo4jv4/pom.xml @@ -10,6 +10,12 @@ jQAssistant Commandline Neo4j 4.x Distribution + + + ${project.basedir}/src/main/resources + true + + org.apache.maven.plugins @@ -88,4 +94,4 @@ - \ No newline at end of file + diff --git a/cli/neo4jv4/src/main/resources/.jqassistant.yml b/cli/neo4jv4/src/main/resources/.jqassistant.yml new file mode 100644 index 0000000000..43932b256c --- /dev/null +++ b/cli/neo4jv4/src/main/resources/.jqassistant.yml @@ -0,0 +1,4 @@ +jqassistant: + store: + embedded: + neo4j-version: ${neo4j_4x.version} diff --git a/cli/neo4jv5/pom.xml b/cli/neo4jv5/pom.xml index d3809d4097..857d4f08a6 100644 --- a/cli/neo4jv5/pom.xml +++ b/cli/neo4jv5/pom.xml @@ -10,6 +10,12 @@ jQAssistant Commandline Neo4j 5.x Distribution + + + ${project.basedir}/src/main/resources + true + + org.apache.maven.plugins @@ -88,4 +94,4 @@ - \ No newline at end of file + diff --git a/cli/neo4jv5/src/main/resources/.jqassistant.yml b/cli/neo4jv5/src/main/resources/.jqassistant.yml new file mode 100644 index 0000000000..6237e4b044 --- /dev/null +++ b/cli/neo4jv5/src/main/resources/.jqassistant.yml @@ -0,0 +1,4 @@ +jqassistant: + store: + embedded: + neo4j-version: ${neo4j_5x.version} diff --git a/cli/test/src/test/resources/.jqassistant-analyze-apoc-neo4jv5.yml b/cli/test/src/test/resources/.jqassistant-analyze-apoc-neo4jv5.yml index b5a6fa8c46..45339d1726 100644 --- a/cli/test/src/test/resources/.jqassistant-analyze-apoc-neo4jv5.yml +++ b/cli/test/src/test/resources/.jqassistant-analyze-apoc-neo4jv5.yml @@ -5,6 +5,5 @@ jqassistant: - group-id: org.neo4j.procedure artifact-id: apoc-core classifier: core - version: @neo4j_5x_apoc.version@ - + version: ${jqassistant.store.embedded.neo4j-version} diff --git a/core/store/src/main/java/com/buschmais/jqassistant/core/store/impl/EmbeddedGraphStore.java b/core/store/src/main/java/com/buschmais/jqassistant/core/store/impl/EmbeddedGraphStore.java index b829756fed..8bd2e7a713 100644 --- a/core/store/src/main/java/com/buschmais/jqassistant/core/store/impl/EmbeddedGraphStore.java +++ b/core/store/src/main/java/com/buschmais/jqassistant/core/store/impl/EmbeddedGraphStore.java @@ -133,10 +133,15 @@ private void logVersion(EmbeddedDatastore embeddedDatastore) { @Override protected void destroy() { neo4jPluginDirectory.ifPresent(directory -> { - try { - FileUtils.deleteDirectory(directory); - } catch (IOException e) { - log.warn("Cannot delete Neo4j plugin directory {}.", directory); + // delete Neo4j plugin directory only if it has not been configured explicitly + if (embedded.neo4jPluginDirectory() + .isEmpty()) { + log.info("Removing Neo4j plugin directory {}.", directory); + try { + FileUtils.deleteDirectory(directory); + } catch (IOException e) { + log.warn("Cannot delete Neo4j plugin directory {}.", directory); + } } }); } diff --git a/manual/src/main/asciidoc/include/configuration.adoc b/manual/src/main/asciidoc/include/configuration.adoc index 837970493a..2eee3db42d 100644 --- a/manual/src/main/asciidoc/include/configuration.adoc +++ b/manual/src/main/asciidoc/include/configuration.adoc @@ -341,9 +341,10 @@ The priorities are as following: `System Property` --> `Environment Variable` -- === Property placeholders -Values may contain placeholders referering to other properties: +Values may contain placeholders referring to other properties: [source,yaml] +..jqassistant.yml ---- src-dir: ./src @@ -362,3 +363,20 @@ The properties in placeholders can be defined in different sources: - environment variables - Maven or user properties specified in the files pom.xml or settings.xml (for the jQAssistant Maven plugin) +[TIP] +==== +The predefined property `jqassistant.store.embedded.neo4j-version` may be used to specify the version of the https://github.com/neo4j/apoc[APOC] plugin for the embedded store (Neo4j v5 only): + +[source,yaml] +..jqassistant.yml +---- +jqassistant: + store: + embedded: + neo4j-plugins: + - group-id: org.neo4j.procedure + artifact-id: apoc-core + classifier: core + version: ${jqassistant.store.embedded.neo4j-version} +---- +==== diff --git a/maven/pom.xml b/maven/pom.xml index 3ec24a2176..1b0032440e 100644 --- a/maven/pom.xml +++ b/maven/pom.xml @@ -42,12 +42,14 @@ src/it/settings.xml - configuration/*/pom.xml + analyze/*/pom.xml cli/*/pom.xml - singlemodule/*/pom.xml - multimodule/*/*/pom.xml + configuration/*/pom.xml list-plugins/pom.xml + multimodule/*/*/pom.xml + neo4j-plugin/pom.xml plugin/pom.xml + singlemodule/*/pom.xml yaml/*/pom.xml @@ -58,6 +60,22 @@ + + + ${project.basedir}/src/main/resources + + .jqassistant.yml + + true + + + ${project.basedir}/src/main/resources + + .jqassistant.yml + + false + + @@ -159,11 +177,6 @@ import pom - - commons-codec - commons-codec - 1.17.1 - diff --git a/maven/src/it/neo4j-plugin/.jqassistant-neo4jv4.yml b/maven/src/it/neo4j-plugin/.jqassistant-neo4jv4.yml new file mode 100644 index 0000000000..bdd2f12870 --- /dev/null +++ b/maven/src/it/neo4j-plugin/.jqassistant-neo4jv4.yml @@ -0,0 +1,10 @@ +jqassistant: + analyze: + groups: + - it + store: + embedded: + neo4j-plugins: + - group-id: org.neo4j.procedure + artifact-id: apoc + version: ${neo4j_4x_apoc.version} diff --git a/maven/src/it/neo4j-plugin/.jqassistant.yml b/maven/src/it/neo4j-plugin/.jqassistant-neo4jv5.yml similarity index 75% rename from maven/src/it/neo4j-plugin/.jqassistant.yml rename to maven/src/it/neo4j-plugin/.jqassistant-neo4jv5.yml index 34821e2f6f..9f1d1fc58d 100644 --- a/maven/src/it/neo4j-plugin/.jqassistant.yml +++ b/maven/src/it/neo4j-plugin/.jqassistant-neo4jv5.yml @@ -1,11 +1,11 @@ jqassistant: + analyze: + groups: + - it store: embedded: neo4j-plugins: - group-id: org.neo4j.procedure artifact-id: apoc-core classifier: core - version: ${apoc.version} - analyze: - groups: - - it + version: ${jqassistant.store.embedded.neo4j-version} diff --git a/maven/src/it/neo4j-plugin/invoker.properties b/maven/src/it/neo4j-plugin/invoker.properties index 81e65bf4c0..a618e7d3c1 100644 --- a/maven/src/it/neo4j-plugin/invoker.properties +++ b/maven/src/it/neo4j-plugin/invoker.properties @@ -1,2 +1,2 @@ invoker.goals.1 = verify -e -invoker.goals.2 = verify -e -Djqassistant.store.embedded.neo4j-plugin-directory=target/jqassistant/plugins +invoker.goals.2 = verify -e -Djqassistant.store.embedded.neo4j-plugin-directory=target/jqassistant/store/plugins diff --git a/maven/src/it/neo4j-plugin/pom.xml b/maven/src/it/neo4j-plugin/pom.xml index 342bec51cb..7158dfd56f 100644 --- a/maven/src/it/neo4j-plugin/pom.xml +++ b/maven/src/it/neo4j-plugin/pom.xml @@ -1,4 +1,5 @@ - + 4.0.0 @project.groupId@ @@ -9,7 +10,28 @@ @project.artifactId@.integration.neo4j-plugin - @neo4j_5x_apoc.version@ + + @neo4j_4x_apoc.version@ - \ No newline at end of file + + + neo4jv4 + + 11 + + + .jqassistant-neo4jv4.yml + + + + neo4jv5 + + [17,) + + + .jqassistant-neo4jv5.yml + + + + diff --git a/maven/src/it/neo4j-plugin/verify.groovy b/maven/src/it/neo4j-plugin/verify.groovy index 591c0874bd..f5027f30a1 100644 --- a/maven/src/it/neo4j-plugin/verify.groovy +++ b/maven/src/it/neo4j-plugin/verify.groovy @@ -5,6 +5,6 @@ def itGroup = jqassistantReport.group.find { it.@id = 'it' } def concept = itGroup.concept.find { it.@id == 'it:APOCHelp' } assert concept.status == 'success' -def pluginDir = new File(basedir, 'target/jqassistant/plugins') -assert pluginDir.exists(); -assert pluginDir.isDirectory(); +def pluginDir = new File(basedir, 'target/jqassistant/store/plugins') +assert pluginDir.exists() +assert pluginDir.isDirectory() diff --git a/maven/src/main/resources/.jqassistant.yml b/maven/src/main/resources/.jqassistant.yml new file mode 100644 index 0000000000..9bd9cd6ef3 --- /dev/null +++ b/maven/src/main/resources/.jqassistant.yml @@ -0,0 +1,4 @@ +jqassistant: + store: + embedded: + neo4j-version: ${neo4j.version} diff --git a/pom.xml b/pom.xml index b0b92118c1..327fc80e23 100644 --- a/pom.xml +++ b/pom.xml @@ -102,7 +102,6 @@ 4.4.36 4.4.0.29 5.23.0 - ${neo4j_5x.version} ${neo4j_4x.version} @@ -173,7 +172,7 @@ com.buschmais.jqassistant jqassistant-maven-plugin - 2.4.0 + 2.5.0-RC2 default