alipay / ant-application-security-testing-benchmark

xAST评价体系,让安全工具不再“黑盒”. The xAST evaluation benchmark makes security tools no longer a "black box".
https://xastbenchmark.github.io
Apache License 2.0
340 stars 45 forks source link

compile ERROR for dast antbenchmark #14

Closed SuwenJunliu closed 6 months ago

SuwenJunliu commented 1 year ago

Hi all,

There might be a Compilation failure when compiling the DAST benchmark.

mvn package -Dmaven.test.skip=true

Here are the output of error message

[INFO] 2 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.954 s
[INFO] Finished at: 2023-09-18T12:55:44+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project antbenchmark: Compilation failure: Compilation failure: 
[ERROR] /home/junliu/ant-application-security-testing-benchmark/dast-java/src/main/java/com/alipay/antbenchmark/tools/pojo/StringMessage.java:[4,33] package javax.xml.bind.annotation does not exist
[ERROR] /home/junliu/ant-application-security-testing-benchmark/dast-java/src/main/java/com/alipay/antbenchmark/tools/pojo/StringMessage.java:[7,2] cannot find symbol
[ERROR]   symbol: class XmlRootElement
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

It might cause by the version of JDK. The project might be fine with JAVA8, and Java 11 removed the Java EE modules according to the release note.

For fixing this issue, maybe we should add the Maven dependencies in POM file

<dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
      <version>2.3.0</version>
    </dependency>
    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-core</artifactId>
      <version>2.3.0</version>
    </dependency>
    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
      <version>2.3.0</version>
    </dependency>
yulailailailai commented 6 months ago

Hi, thank you for discovering the issue that the compilation of DAST shooting range may be affected by the Java version. We have evaluated the necessity of "/com/alipay/antbenchmark/tools/pojo/StringMessage.java" and have decided to delete this file to resolve the compilation errors caused by Java version differences