Get Started – Scan, explore and validate your Java application in a few minutes.
Select your preferred option:
Installation
Download the commandline distribution and unpack it. Check here for a more recent or older version.
Scan
Windows
bin\jqassistant.cmd scan -f lib
Linux
bin/jqassistant.sh scan -f lib
The JAR files contained in the lib/ folder will be scanned.
Explore
Windows
bin\jqassistant.cmd server
Linux
bin/jqassistant.sh server
Open a browser and navigate to http://localhost:7474
Enter the following query in the top level area and hit Ctrl-Enter:
MATCH
(a:Artifact)-[:CONTAINS]->(t:Type)-[:DECLARES]->(m:Method)
RETURN
a.fileName as Artifact, t.fqn AS Type, count(t) AS DeclaredMethods
ORDER BY
DeclaredMethods DESC
LIMIT 20
Add the plugin
Add the following lines to the parent pom.xml file of your project:
<properties>
<!-- Define your desired jQAssistant version here -->
<jqassistant.version>...</jqassistant.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.buschmais.jqassistant</groupId>
<artifactId>jqassistant-maven-plugin</artifactId>
<version>${jqassistant.version}</version>
<executions>
<execution>
<goals>
<goal>scan</goal>
<goal>analyze</goal>
</goals>
<configuration>
<warnOnSeverity>MINOR</warnOnSeverity>
<failOnSeverity>MAJOR</failOnSeverity>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Add a rule
Within your parent module create a directory „jqassistant“ and a rules file „my-rules.adoc“:
jqassistant/my-rules.adoc
= My Project
// Include a summary of all executed rules and their status
include::jQA:Summary[]
[[default]]
[role=group,includesConstraints="my-rules:*"]
== Default Rules
[[my-rules:TestClassName]]
[source,cypher,role=constraint,requiresConcepts="junit4:TestClass"]
----
MATCH
(t:Junit4:Test:Class)
WHERE NOT
t.name ends with "Test"
RETURN
t AS InvalidTestClass
----
== Imported Rules
// Include specific rules that have been executed and their results.
include::jQA:Rules[concepts="junit*:*"]
Run the build
Execute the following command from your parent module:
mvn install
The build will fail with the message specified by your rule if it is violated.
Furthermore an HTML document with embedded rule results is available at „target/jqassistant/report/asciidoc/index.html“.
Explore your application
jQAssistant comes with an integrated Neo4j server, you can run it using
mvn jqassistant:server
Open a browser and navigate to http://localhost:7474
Enter the follwoing query in the top level area and hit Ctrl-Enter:
MATCH
(t:Type)-[:DECLARES]->(m:Method)
RETURN
t.fqn AS Type, count(t) AS DeclaredMethods
ORDER BY
DeclaredMethods DESC
LIMIT 20
If you’re looking for a more advanced example based on Maven have a look at the
Spring PetClinic example and its
demo output on GitHub. It provides a running setup including rules for verification of:
- Naming Conventions
- Package based layering
- Spring component dependencies
- Test design
Interested in an example about Architecture Decision Records or Juypter Notebooks with jQAssistant? There’s an enriched fork of Germany’s Corona Warn App (CWA) Server available on
GitHub, instructions can be found in the file
README-jQAssistant.md.
We’ve prepared tutorials demonstrating common scenarios of using or extending jQAssistant. Just visit
https://101.jqassistant.org and dive in!