jQAssistant 1.7.0 released
jQAssistant 1.7.0 released
2. Oktober 2019 Keine Kommentare zu jQAssistant 1.7.0 releasedWe released jQAssistant 1.7.0 and you should watch out for the following improvements:
@jQASuppress annotation
It is now possible to suppress reported violations by adding the annotation @jQASuppress and the ids of rules to Java elements, e.g.
@jQASuppress({ "my-rules:Constraint1", "my-rules:Constraint2") public class MyClass { ...
The annotation is provided by the Java scanner plugin which must be specified as dependency, e.g. for Maven projects:
<dependencies> <dependency> <groupId>com.buschmais.jqassistant.plugin</groupId> <artifactId>java</artifactId> <version>1.7.0</version> <scope>provided</scope> </dependency> </dependencies>
The scope of the dependency is declared as provided. This makes the annotation available at compile time but does not package the jQAssistant Java plugin into the deliverable of your application (note that it is GPLv3 licensed).
Scanner for Maven Repositories
The M2repo plugin already existed for a longer time but it has now been reworked and is now out of an experimental state.
It allows you to scan the content of Maven repositories by using the command line utility:
bin/jqassistant.sh scan -u maven:repository::http://host/repository bin\jqassistant.cmd scan -u maven:repository::http://host/repository
This will read the index of the repository behind the given URL, fetch pom.xml files, resolve them and store their information (e.g. dependencies, plugins, licenses, developers) etc. in the database for further exploration. For available options refer to the plugin documentation.
If you’re now asking if it is possible to scan large repositories: the answer is yes, we’re verifying it with the content of Maven Central.
Example: What’s the most often used version of the SLF4j API?
MATCH (:GroupId{name:"org.slf4j"})-[:CONTAINS_ARTIFACT_ID]->(:ArtifactId{name:"slf4j-api"})-[:CONTAINS_VERSION]->(v)-[:CONTAINS_ARTIFACT]->(a:Artifact), (pom:Pom)-[:DECLARES_DEPENDENCY]->(a) RETURN v.name as Version, count(a) as DeclaredDependencies ORDER BY DeclaredDependencies desc LIMIT 10
Exclusions in Maven Dependencies
The Maven pom.xml scanner plugin now reports excluded dependencies:
(:Pom)-[:DECLARES]->(dependency:Maven:Dependency)-[:TO_ARTIFACT]->(:Maven:Artifact), (dependency)-[:EXCLUDES]->(exclusion:Maven:Exclusion)
The exclusion nodes provide two properties: groupId and artifactId.
Neo4j
The Neo4j V2 distribution finally has been dropped, only Neo4j V3 is supported from now on.
The distribution comes with release 3.5.9 of the graph database and furthermore with the APOC and Graph Algorithm libraries. These must be explicitly activated, i.e. for Maven:
<plugin> <groupId>com.buschmais.jqassistant</groupId> <artifactId>jqassistant-maven-plugin</artifactId> <version>1.7.0</version> <configuration> <store> <embedded> <apocEnabled>true</apocEnabled> <graphAlgorithmsEnabled>true</graphAlgorithmsEnabled> </embedded> </store> </configuration> </plugin>
and the command line utility:
bin/jqassistant.sh server -embeddedApocEnabled true -embeddedGraphAlgorithmsEnabled true bin\jqassistant.cmd server -embeddedApocEnabled true -embeddedGraphAlgorithmsEnabled true
The full list of changes is available in the Release Notes.
Distributions
Users of the Maven plugin just need to update the jQAssistant version in their pom.xml file:
<plugin> <groupId>com.buschmais.jqassistant</groupId> <artifactId>jqassistant-maven-plugin</artifactId> <version>1.7.0</version> ... </plugin>
The command line distribution is available for download here.
Updates from the Contribution Area
Despite updating several existing plugins there’s the new jQAssistant Dashboard Plugin. After activating it the embedded Neo4j server provides the following dashboard under the URL http://localhost:7474/jqassistant/dashboard:
The Spring PetClinic demo comes with an example setup. Just clone it, run „mvn clean install“, „mvn jqassistant:server“ and open your browser with the URL above.
The PetClinic as well contains the setup for the following other plugins that have been updated to work with jQAssistant 1.7.0:
- Asciidoc Report Plugin – Renders Asciidoc documents containing jQAssistant rules including results as tables or diagrams
- PlantUML Rule Plugin – Use PlantUML diagrams to create concepts and constraints
- Kontext E’s Git Plugin and Test Impact Analysis Plugin (branch „jqa-testimpact-analysis“) – Select tests for execution that are affected by SCM changes on the current branch
Leave a comment