我正在嘗試在 Spring Boot 應用程式上運行一些漏洞掃描(Veracode)。但是,掃描提供程式建議使用在除錯模式下使用以下檔案編譯的二進制檔案運行掃描pom.xml。
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<debug>true</debug>
<debuglevel>lines,vars,source</debuglevel>
</configuration>
</plugin>
</plugins>
</build>
但是,我們pom.xml在不需要除錯級別 jar 的生產部署中使用相同的方法。
有沒有辦法通過向mvn命令傳遞一些引數來創建除錯 jars ?
uj5u.com熱心網友回復:
我認為可以-D像這樣在命令列中設定引數:
mvn compile -Dmaven.compiler.debug=true -Dmaven.compiler.debuglevel=lines,vars,source
uj5u.com熱心網友回復:
您可以使用組態檔。
<profiles>
<profile>
<id>debug</id>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<debug>true</debug>
<debuglevel>lines,vars,source</debuglevel>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profile>
組態檔在mvn命令中激活,例如,mvn ... -Pdebug。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/368441.html
上一篇:將資料表以JSON格式(ajax)傳遞給MVC控制器(JAVA)
下一篇:SpringJPA關系
