Skip to content

Tools configuration

Mariha Kozinska edited this page Apr 13, 2019 · 2 revisions

Maven config

Compile-time data-flow verification:

For multi-module maven project, we defined default configuration in parent pom file. Sub-modules can expand it with additional compiler options, if in parent pom <compilerArgs> element has combine.children="append" attribute set (otherwise parent config is overwritten).

Runtime validation of input data:

  • Java Beans Validation API dependencies set up in maven. Note that you'll need api and reference implementation jars.
   <dependency>
      <!-- Java Beans Validation API -->
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
   </dependency>
   <dependency>
      <!-- Hibernate Validator: reference implementation of the Java Bean Validation API. -->
      <groupId>org.hibernate.validator</groupId>
      <artifactId>hibernate-validator</artifactId>
   </dependency>
   <dependency>
      <!-- Unified Expression Language: reference implementation for Hibernate Validator -->
      <groupId>org.glassfish</groupId>
      <artifactId>javax.el</artifactId>
   </dependency>

IntelliJ setup

  1. for IJ build-in parser and inspections, so that IJ understands @Nullable and the default not-null and highlight issues - TBD
  2. for error-prone and null-away, IJ can be hooked to use javac with error-prone extension and null-away (as annotation processor).
  3. for checker-framework

Other configuration options (command line compiler flags)

Sonar until v5.5 may raise false positives on @Nullable annotated types. To fix this, make sure that you provided bytecode of annotations from the JSR-305 for sonar analyses. JSR-305 annotations are used as meta-annotations to describe @Nullable behavior.