2014-02-11 47 views

回答

4

對於我的插件,我在構建期間將一個字段嵌入名爲Implementation-Version的MANIFEST.MF文件中。然後我讀在這一領域的運行時,通過訪問這樣的包:

def pkg = MyPlugin.class.getPackage() 
return pkg.implementationVersion 

或使用輔助類,如:https://github.com/nebula-plugins/nebula-core/blob/master/src/main/groovy/nebula/core/ClassHelper.groovy#L16從清單搶任意字段。

+1

它工作正常,謝謝。用於在清單中添加屬性的片段:'jar {清單{ }屬性(「Implementation-Version」:版本) } }'' – Vincent

相關問題