Search code examples
javamavenveracode

Veracode Greenlight scan in multimodule maven projects


I'm trying to scan a maven project using greenlight. It runs smoothly when the project is single module (src and target folder are at the root) but fails when is multi-module. Multimódule means :

root
  -- module-one
       -- src
       -- target
  -- module-two
       -- src
       -- target

and so on.

The greenlight jar is looking for builds in the wrong place and I can not found any way to indicate the correct path

java -jar gl-scanner-java.jar [params...] -b target/classes The results is the expectec because the target classes folder is not there

GREENLIGHT SEVERE: Provided build directory 'path/./target/classes' is not a directory or not accessible: skipping pair #1.

java -jar gl-scanner-java.jar [params...] -b module-one/target/classes The build path is wrong:

Source file:   module-one/src/main/java/.../ByteCodeChange.java
Build file:   module-one/module-one/target/classes/.../ByteCodeChange.class

And of course fail:

GREENLIGHT SEVERE: Unable to create JAR 'path/module-one/module-one/target/classes/.../ByteCodeChange.class': Problem accessing input file: module-one/module-one/target/classes/.../ByteCodeChange.class (No such file or directory)

Does not matter about the -b paramater is passed, it will never found the correct build path but take a look the source file found is the correct one.

Could some one help me. Thanks!


Solution

  • try specifying multiple source and build directories:

    -s module-one/src/main/java,module-two/src/main/java \
    -b module-one/target/classes,modules-two/target/classes