【问题标题】:Use local assets in SonarQube 6.3.1 custom plugin's web page在 SonarQube 6.3.1 自定义插件的网页中使用本地资产
【发布时间】:2017-11-10 03:15:39
【问题描述】:

我想在 SonarQube 6.3.1 的自定义网页中插入一些图片。我尝试将它放在资源/静态中,例如 javascript 文件,并使用 <img src="image.png"></img> 调用它,但它不起作用。

我不太了解 SonarQube 如何管理静态文件夹中的自定义页面。我关注了official guide,但我不明白例如如何在我的页面的js文件中使用外部资源(图像、html模板等)。

感谢您的帮助, 贝努瓦

【问题讨论】:

    标签: plugins sonarqube webpage


    【解决方案1】:

    我终于找到了如何使用我的资产:

    1. 把你的资产放到src/main/ressources/static,比如我在这里加了一张图片src/main/ressources/static/images/loading.gif
    2. 让 myplugin 我的插件标识符
    3. 我可以在 src/main/ressources/static/page.js 中使用我的 gif,就像这样 <img src="../../static/myplugin/static/images/loader.gif"></img>

    也许它可以帮助某人......

    【讨论】:

      猜你喜欢
      • 2017-11-11
      • 1970-01-01
      • 1970-01-01
      • 2015-11-11
      • 2015-10-07
      • 1970-01-01
      • 2014-04-22
      • 1970-01-01
      • 2012-03-24
      相关资源
      最近更新 更多