sentinel是今年阿里開源的高可用防護的流量管理框架。
git地址:https://github.com/alibaba/Sentinel
wiki:https://github.com/alibaba/Sentinel/wiki
FAQ:https://github.com/alibaba/Sentinel/wiki/FAQ
--------------------------------------------------------------------------------------------------------------------------------------------------------
工程里有很多單元測試,在IDEA里運行時報錯:
����: �Ҳ��������������� @{argLine}
錯誤信息有亂碼,VM參數加上-Dfile.encoding=UTF-8,再次運行:
錯誤: 找不到或無法加載主類 @{argLine}
解決方法:File->Settings->Build,Execution,Deployment->Build Tools->Maven->Running Tests 去掉argLine的勾選
--------------------------------------------------------------------------------------------------------------------------------------------------------
ctrl+shift+F全局搜索@{argLine},發現在sentinel-parent父工程的pom.xml里,使用了一個maven插件
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <!-- CircleCI build workaround --> <argLine>@{argLine} -Xms1024m -Xmx2048m</argLine> <useSystemClassLoader>false</useSystemClassLoader> </configuration> </plugin>
參考maven官方文檔:http://maven.apache.org/surefire/maven-surefire-plugin/faq.html#late-property-evaluation
allows late replacement of properties when the plugin is executed, so properties that have been modified by other plugins will be picked up correctly.
該占位符能讓后面的插件在執行時正確的替換屬性。
sentinel官方團隊也在釘釘群給了說明:
這是 CI 生成測試覆蓋率報告的時候自動裝填用的,本地可以去掉。