Maven

本文介绍如何在Maven环境中配置Nexus作为仓库镜像,并设置Sonar进行代码质量检查。文中提供了详细的XML配置示例,包括连接Nexus的镜像配置及Sonar的数据库连接设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Maven Version: apache-maven-2.2.1 official web site: http://maven.apache.org/ Download Page: http://maven.apache.org/download.html Note: I strongly recommend that you use maven 2 rather than maven 3; maven 3 is not yet stable enough when I write this document.

Now open the "MAVEN_HOME\conf\setting.xml" and make some changes to make the Nexus take effective in maven.

Xml代码
  1. <mirror>
  2. <id>nexus</id>
  3. <mirrorOf>*</mirrorOf>
  4. <url>http://localhost:8080/nexus/</url>
  5. </mirror>

And make the following changes to make sonar take effective in maven.
Xml代码
  1. <profile>
  2. <id>sonar</id>
  3. <activation>
  4. <activeByDefault>true</activeByDefault>
  5. </activation>
  6. <properties>
  7. <!--EXAMPLEFORMYSQL-->
  8. <sonar.jdbc.url>
  9. jdbc:mysql://localhost:3306/sonar?useUnicode=true&amp;characterEncoding=utf8
  10. </sonar.jdbc.url>
  11. <sonar.jdbc.driverClassName>com.mysql.jdbc.Driver</sonar.jdbc.driverClassName>
  12. <sonar.jdbc.username>sonar</sonar.jdbc.username>
  13. <sonar.jdbc.password>sonar</sonar.jdbc.password>
  14. <!--optionalURLtoserver.Defaultvalueishttp://localhost:9000-->
  15. <sonar.host.url>
  16. http://localhost:8080/sonar
  17. </sonar.host.url>
  18. </properties>
  19. </profile>

Xml代码
  1. <activeProfiles>
  2. <activeProfile>sonar</activeProfile>
  3. </activeProfiles

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值