Skip to content

Commit 11234a2

Browse files
committed
Replace jQAssistant with ArchUnit.
1 parent 60dd429 commit 11234a2

File tree

8 files changed

+129
-251
lines changed

8 files changed

+129
-251
lines changed

etc/adr/general-discussion.adoc

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -238,16 +238,8 @@ core-[hidden]--->repository
238238
|===
239239

240240
=== Architecture validation
241-
The structure of this project can be explored as a Graph.
242-
We use https://jqassistant.org[jQAssistant] to verify our architecture during the build.
243-
Run the following two commands
244-
245-
```
246-
./mvnw clean compile jqassistant:scan
247-
./mvnw jqassistant:server
248-
```
249-
250-
and point your browser to http://localhost:7474.
241+
In favour of lightweight builds and JDK restriction of Neo4j, we moved away from https://jqassistant.org[jQAssistant] (still a great tool) and
242+
have now https://www.archunit.org[ArchUnit] in place.
251243

252244
=== `SimpleNeo4jRepository` initialization
253245
. `@EnableNeo4jRepositories` defines

etc/jqassistant/api.adoc

Lines changed: 0 additions & 53 deletions
This file was deleted.

etc/jqassistant/index.adoc

Lines changed: 0 additions & 27 deletions
This file was deleted.

etc/jqassistant/naming.adoc

Lines changed: 0 additions & 16 deletions
This file was deleted.

etc/jqassistant/structure.adoc

Lines changed: 0 additions & 37 deletions
This file was deleted.

pom.xml

Lines changed: 11 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@
6969

7070
<properties>
7171
<apiguardian.version>1.1.1</apiguardian.version>
72+
<archunit.version>0.23.1</archunit.version>
7273
<asciidoctor-maven-plugin.version>2.1.0</asciidoctor-maven-plugin.version>
7374
<asciidoctorj-diagram.version>2.1.0</asciidoctorj-diagram.version>
74-
7575
<byte-buddy.version>1.11.0</byte-buddy.version>
7676
<cdi>3.0.1</cdi>
7777
<checkstyle.skip>${skipTests}</checkstyle.skip>
@@ -86,10 +86,6 @@
8686
<java-module-name>spring.data.neo4j</java-module-name>
8787
<java.version>17</java.version>
8888
<jaxb.version>2.3.1</jaxb.version>
89-
<jqassistant-dashboard-plugin.version>1.10.0</jqassistant-dashboard-plugin.version>
90-
<jqassistant.plugin.git.version>1.8.0</jqassistant.plugin.git.version>
91-
<jqassistant.plugin.version>1.10.1</jqassistant.plugin.version>
92-
<jqassistant.version>1.10.1</jqassistant.version>
9389
<junit-cc-testcontainer>2021.0.1</junit-cc-testcontainer>
9490
<maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
9591
<maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
@@ -230,6 +226,11 @@
230226
<type>pom</type>
231227
<scope>import</scope>
232228
</dependency>
229+
<dependency>
230+
<groupId>com.tngtech.archunit</groupId>
231+
<artifactId>archunit</artifactId>
232+
<version>${archunit.version}</version>
233+
</dependency>
233234
</dependencies>
234235
</dependencyManagement>
235236

@@ -437,6 +438,11 @@
437438
</exclusion>
438439
</exclusions>
439440
</dependency>
441+
<dependency>
442+
<groupId>com.tngtech.archunit</groupId>
443+
<artifactId>archunit</artifactId>
444+
<scope>test</scope>
445+
</dependency>
440446
</dependencies>
441447

442448
<repositories>
@@ -482,27 +488,6 @@
482488
<expandEmptyElements>false</expandEmptyElements>
483489
</configuration>
484490
</plugin>
485-
<plugin>
486-
<groupId>com.buschmais.jqassistant</groupId>
487-
<artifactId>jqassistant-maven-plugin</artifactId>
488-
<version>${jqassistant.version}</version>
489-
<dependencies>
490-
<dependency>
491-
<groupId>de.kontext-e.jqassistant.plugin</groupId>
492-
<artifactId>jqassistant.plugin.git</artifactId>
493-
<version>${jqassistant.plugin.git.version}</version>
494-
</dependency>
495-
<dependency>
496-
<groupId>org.jqassistant.contrib.plugin</groupId>
497-
<artifactId>jqassistant-dashboard-plugin</artifactId>
498-
<version>${jqassistant-dashboard-plugin.version}</version>
499-
</dependency>
500-
</dependencies>
501-
<configuration>
502-
<rulesDirectory>etc/jqassistant</rulesDirectory>
503-
<skip>${skipArchitectureTests}</skip>
504-
</configuration>
505-
</plugin>
506491
<plugin>
507492
<groupId>org.jacoco</groupId>
508493
<artifactId>jacoco-maven-plugin</artifactId>
@@ -712,45 +697,6 @@
712697
</archive>
713698
</configuration>
714699
</plugin>
715-
<plugin>
716-
<groupId>com.buschmais.jqassistant</groupId>
717-
<artifactId>jqassistant-maven-plugin</artifactId>
718-
<executions>
719-
<execution>
720-
<id>jqassistant-scan</id>
721-
<phase>verify</phase>
722-
<goals>
723-
<goal>scan</goal>
724-
</goals>
725-
<configuration>
726-
<scanProperties>
727-
<jqassistant.plugin.jacoco.filename>jacoco.xml</jqassistant.plugin.jacoco.filename>
728-
</scanProperties>
729-
<scanIncludes>
730-
<scanInclude>
731-
<path>${project.basedir}/.git</path>
732-
</scanInclude>
733-
<scanInclude>
734-
<path>${project.reporting.outputDirectory}/jacoco</path>
735-
</scanInclude>
736-
</scanIncludes>
737-
</configuration>
738-
</execution>
739-
<execution>
740-
<id>jqassistant-analyze</id>
741-
<goals>
742-
<goal>analyze</goal>
743-
</goals>
744-
<configuration>
745-
<failOnSeverity>MINOR</failOnSeverity>
746-
<groups>
747-
<group>default</group>
748-
<group>jqassistant-dashboard:Default</group>
749-
</groups>
750-
</configuration>
751-
</execution>
752-
</executions>
753-
</plugin>
754700
<plugin>
755701
<groupId>org.apache.maven.plugins</groupId>
756702
<artifactId>maven-compiler-plugin</artifactId>

src/main/asciidoc/appendix/build.adoc

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -152,46 +152,3 @@ There is no quality gate in place at the moment to ensure that the code/test rat
152152
We have some rather mild checkstyle rules in place, enforcing more or less default Java formatting rules.
153153
Your build will break on formatting errors or something like unused imports.
154154

155-
[[building-SDN.jqassistant]]
156-
=== jQAssistant
157-
158-
WARNING: Verification of those rules is off by default since Spring Data Neo4j 7, as the it requires JDK 17 to build.
159-
The currently available version of jQAssistant does not run without several `--add-opens` arguments to the Java
160-
module system and we won't apply this to the whole build as we must ensure that SDN itself does *not* need them.
161-
+
162-
To execute the rules during a build run the build like this:
163-
+
164-
+
165-
`MAVEN_OPTS="--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED" ./mvnw -DskipArchitectureTests=false -DskipTests=true verify`
166-
167-
168-
We also use https://jqassistant.org[jQAssistant], a Neo4j-based tool, to verify some aspects of our architecture.
169-
The rules are described with Cypher and your build will break when they are violated:
170-
171-
include::../../../../etc/jqassistant/index.adoc[leveloffset=4]
172-
173-
[[building-SDN.jqassistant.database]]
174-
==== Accessing the jQAssistant database
175-
176-
jQAssistant uses Neo4j to store information about a project.
177-
To access the database, please build the project as described above.
178-
When the build finishes, execute the following command:
179-
180-
[source,console,subs="verbatim,attributes"]
181-
[[start-jqassistant]]
182-
.Start jQAssistant
183-
----
184-
$ MAVEN_OPTS="--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED" ./mvnw -DskipArchitectureTests=false jqassistant:server
185-
----
186-
187-
Access the standard Neo4j browser at http://localhost:7474 and a dedicated jQA-Dashboard at http://localhost:7474/jqassistant/dashboard/.
188-
189-
The scanning and analyzing can be triggered individually, without going through the full verify again:
190-
191-
[source,console,subs="verbatim,attributes"]
192-
[[scan-with-jqassistant]]
193-
.Manually scan and analyze the main project
194-
----
195-
$ MAVEN_OPTS="--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED" ./mvnw -DskipArchitectureTests=false jqassistant:scan@jqassistant-scan
196-
$ MAVEN_OPTS="--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED" ./mvnw -DskipArchitectureTests=false jqassistant:analyze@jqassistant-analyze
197-
----

0 commit comments

Comments
 (0)