Maven 连接到声纳
我在本地计算机上安装了 Maven,并且正在尝试测试安装在远程机器上的声纳。
我在网上找到了一些帖子来配置 settings.xml
(maven\config\settings.xml)
并附加配置文件条目...我做了但不起作用
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- SERVER ON A REMOTE HOST -->
<sonar.host.url>http://remotebox:9000</sonar.host.url>
</properties>
</profile>
什么是cli方式吗?我尝试了几种选择,但没有任何效果。
我尝试过: mvn sonar:sonar http://remotebox:9000
正确的语法是什么?
提前致谢。 达米安
PS.这在安装了 Maven 和声纳的远程盒子上工作得很好...我只是想在远程盒子上尝试一下我的盒子。
I have maven installed on my local machine and I'm trying to test out Sonar installed on a remote box.
I found a few post online to configure settings.xml
(maven\config\settings.xml)
and append a profile entry...which I did but does not work
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- SERVER ON A REMOTE HOST -->
<sonar.host.url>http://remotebox:9000</sonar.host.url>
</properties>
</profile>
What is the cli way? I tried several options but nothing worked.
I tried: mvn sonar:sonar http://remotebox:9000
What is the correct syntax?
Thanks in advance.
Damian
PS. this works fine on the remote box where both maven and sonar are installed...i just want to try it my box to the remote box.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
运行声纳
,其中 ipaddr 是您的远程主机,似乎可以工作。
Running sonar with
,where ipaddr is your remote host, seems to work.
直到版本 5.2,除了
sonar.host.url
之外,您还必须按照 此处。这样对我有用。配置示例
从版本 5.2 开始,这不再是必要的:
引用:
扫描仪不访问数据库
这是这个新版本最大的变化:扫描仪(例如Sonar Runner)不再访问数据库,它们仅使用Web服务与服务器通信。实际上,这意味着现在可以从分析 CI 作业中删除 JDBC 连接属性:
声纳.jdbc.url,
sonar.jdbc.用户名,
sonar.jdbc.password
Up to Version 5.2 beside the
sonar.host.url
you also have to specify the database parameters as described here. That way it works for me.Configuration example
Since Version 5.2 this not not necessary anymore:
Quote:
Scanners don't access the database
This is the biggest change of this new version: scanners (e.g. Sonar Runner) no longer access the database, they only use web services to communicate with the server. In practice, this means that the JDBC connection properties can now be removed from analysis CI jobs:
sonar.jdbc.url,
sonar.jdbc.username,
sonar.jdbc.password
以下内容适用于
sonar-maven-plugin:3.2
:mvn sonar:sonar -Dsonar.host.url=http://:
>Just the following works for
sonar-maven-plugin:3.2
:mvn sonar:sonar -Dsonar.host.url=http://<sonarqubeserver>:<port>
问题 1
正如所解释的,您需要指定 JDBC 连接详细信息,否则 Sonar 将尝试与嵌入式 Derby 实例通信,它假设在本地主机上运行。
问题2
您使用Derby 吗?那么,Derby 的默认配置不接受远程连接,而只接受来自同一主机的连接。
SONAR-1039 问题解释了如何解决此问题,但我的建议是设置一个完整的-崩溃的数据库,例如 MySQL 或 Postgresql。
Problem 1
As explained you need to specify the JDBC connection details, otherwise Sonar will attempt to talk to the embedded Derby instance, it assumes is running on localhost.
Problem 2
Are you using Derby? Well, the default configuration of Derby does not accept remote connections, but only connections from the same host.
The SONAR-1039 issue explains how to work-around this problem, but my advise would be to setup a full-blown database such as MySQL or Postgresql.
我遇到了一些问题,然后意识到,我在父 pom 上运行 mavn,而声纳配置在子 pom 中,无论如何我都想要分析报告,因此使用子 pom 运行 mvn sonar:sonar 是有效的。
I had some problem and then realized, I was running mavn on parent pom whereas sonar configuration was in a child pom, for which I wanted analysis report anyway, so running mvn sonar:sonar with child pom worked.