sMannem108028 (Community Member) asked a question.

Error while scanning the java class. Can you please help us here ?

Veracode_error_1When I tried to scan one of our java class in Maven project, we got the below error in eclipse pop up window-

"Please clean and rebuild the project with eclipse. If you are using third-party build tool, you must disable it and build the project with the default Eclipse Java builder"

 


  • Hi @sMannem108028 (Community Member)​ - thanks for your patience! I've checked with our Support team and here is the feedback: Veracode Greenlight for Eclipse only supports Eclipse binaries, which means you may experience problems when scanning projects built with third-party build automation tools such as Maven or Gradle.

     

    If you are compiling with Maven or Gradle, Veracode recommends that you use the Eclipse plugin for that build tool to import your files. After you import the project into Eclipse using the Maven or Gradle plugin, if you are still experiencing issues scanning your Eclipse project with Veracode Greenlight, try the following actions:

     

                  • Gradle: If you compiled your files using Gradle, you must be using the java plugin. For example, the build.gradle file must contain apply plugin: 'java'.

                  • Maven: If you compiled your files using Maven and then imported these files, the .project file should contain the java and maven natures. You can manually add them to the .project file as follows:

     

    <buildCommand>

    <name>org.eclipse.jdt.core.javabuilder</name>

    <arguments>

    </arguments>

    </buildCommand>

    <buildCommand>

    <name>org.eclipse.m2e.core.maven2Builder</name>

    <arguments>

    </arguments>

    </buildCommand>

    </buildSpec>

    <natures>

    <nature>org.eclipse.jdt.core.javanature</nature>

    <nature>org.eclipse.m2e.core.maven2Nature</nature>

    </natures>

     

    Note: Any project must build successfully outside of Eclipse. If you have problems such as classpath or buildpath errors, for example, Eclipse cannot build the files needed to submit a scan to Veracode Greenlight.

     

    Hope this helps!

    Expand Post
    • SMannam248080 (Community Member)

      Hi, I also have same issue added the above lines in .project file but still getting same error message

Topics (1)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.