我最近安装了SonarQube 5.0.1,但我找不到将问题标记为假阳性的位置.在以下选项的下拉框中,唯一的选项是"链接到JIRA",我以管理员身份登录.
此功能现在是作为可选插件的一部分提供的吗?
编辑:我添加了一个完全在UI中看到的屏幕截图.
我有一个版本0.0.1-SNAPSHOT的项目,当我们通过TeamCity构建它时,我们还得到一个build.vcs.number属性,这是触发构建的Subversion修订版.
在我们的程序集中,我们创建一个名为foo-distribution-0.0.1-SNAPSHOT.zip的zip文件,但我想知道是否有一种方法可以将build.vcs.number属性插入到工件名称中以给foo- distribution-0.0.1.12345-SNAPSHOT.zip?
是否有内置属性只是版本号的数字部分,或者其他一些分割-SNAPSHOT部分的方法?
编辑:我已经尝试将pom.xml版本设置为$ {my.version} -SNAPSHOT,然后在属性中定义my.version - 这适用于除了Maven Release Plugin之外的任何情况,它抱怨它无法解析版本(可以理解,它不能自动猜测下一个开发版本).
在企业环境中在Windows上运行IntelliJ时,.IntelliJ文件夹很快就会超出您的配置文件限额(特别是如果您使用的是Maven) - 有没有办法让IntelliJ指向此文件夹的备用位置?
我正在从TeamCity运行maven构建并使用build.vcs.number将Subversion修订版写入我的清单.在使用Subversion作为VCS的任何Maven构建中,TeamCity补充道
-Dbuild.vcs.number=1234
Run Code Online (Sandbox Code Playgroud)
到maven命令行,其中1234是正在构建的分支中的最新修订版.
然后在我的pom.xml中,我有
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<build>${build.vcs.number}</build>
</manifestEntries>
</archive>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
这一切都正常,直到我运行Maven release:perform(也来自TeamCity),此时$ {build.vcs.number}变为null,即使我在TeamCity构建日志中可以看到该属性是在命令中传入的线.
maven-release-plugin文档暗示Maven在执行目标期间的某个时刻运行分叉进程 - 这就是我遇到问题的原因吗?
有没有办法可以确保将此特定属性传递给该分叉进程?
不确定为什么会发生这种情况,但是当我在命令行中运行解压缩文件(例如apache-groovy-binary-2.4.7.zip)时......
rwx-r-xr-x
rwxr-xr-x
或rw-r--r--
但是当我zipfile.extractall()
在同一个文件上运行Python 2.7脚本时......
rwx-r-x---
rw-r----
- 甚至是应该是可执行文件的文件.我的umask
设置是0027
- 这部分解释了发生了什么,但为什么可执行位从所有文件中删除?
让Python在命令行版本中采用类似行为的最简单的解决方法是什么(当然,除了炮轰外!)?
我有一些开发人员不满意将他们的LDAP用户名/密码存储在settings.xml中以访问Nexus.他们的不满是部分FUD,但也是在他们的LDAP密码到期时不得不重新加密密码的不便(这在这里相对频繁).
有没有办法让Maven使用SSO/LDAP?我们使用的工件存储库是Nexus,其Web前端确实使用了SSO.
给定以下依赖项包含一个Maven程序集XML ...
<dependencySet>
<includes>
<include>com.company.product:library:jar:*:*</include>
</includes>
Run Code Online (Sandbox Code Playgroud)
...为什么上面的过滤器不能包含库:jar没有分类器?
[INFO] Reading assembly descriptor: assembly/release.xml
[WARNING] The following patterns were never triggered in this artifact inclusion filter:
o 'com.company.product:library:jar:*:*'
Run Code Online (Sandbox Code Playgroud)
在我的模式中添加通配符的原因是我还有一个配置文件,用分类器"qa"构建我的所有库.当我激活该配置文件时,一切正常,但在默认配置文件(构建没有分类器的库)下,它会失败.
如果我将过滤器更改为:
<include>com.company.product:library*</include>
Run Code Online (Sandbox Code Playgroud)
然后maven构建实际上失败了,出现此错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-
plugin:2.3:single (make-assembly) on project java-package: Failed to create
assembly: Error adding file 'com.company.product:library:jar:1.0.0-SNAPSHOT'
to archive: C:\Subversion\JavaProj\library\target\classes isn't a file. -> [Help 1]
Run Code Online (Sandbox Code Playgroud)
有人可以建议一个包含罐子的模式,无论是否有分类器?
我在 Sonar 中为 Maven 插件项目(使用调用者插件进行集成测试)获取集成测试和单元测试的代码覆盖率报告时遇到了一些问题。
我不能对单元测试使用默认的 Jacoco 覆盖工具,因为它们使用 Powermock,这导致使用它的类的覆盖率为 0%。另一方面,在不使用 Jacoco 的情况下,我找不到一种可靠的方法来获得基于 Groovy 的集成测试的结果。
所以我需要的是 Cobertura 生成单元测试报告,Jacoco 生成集成测试报告,以及 Sonar 能够读取大量内容。
我尝试使用此处的示例https://github.com/Godin/sonar-experiments/tree/master/jacoco-examples/maven-invoker-plugin-example但消除了绑定到测试阶段的执行,但随后我得到了声纳中“-”的单元测试覆盖率。我认为这样做的原因是为了让这种方法起作用,我需要将 Jacoco 指定为 Sonar 的核心覆盖工具。
关于这个的任何想法?我的 pom.xml 如下:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.acme.myproj.plugins</groupId>
<artifactId>slice2java-maven-plugin</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>Slice2Java Maven Plugin</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sonar.exclusions>**/generated*/*.java</sonar.exclusions>
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.jacoco.itReportPath>${project.basedir}/target/jacoco-it.exec</sonar.jacoco.itReportPath>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.0.8</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
<scope>test</scope>
</dependency>
<dependency> …
Run Code Online (Sandbox Code Playgroud) 当我们的公共组(包含Maven Central代理等)运行重新索引时,我收到以下错误; 然而,运行df -k我看不到任何接近满的设备......事实上,安装的分区Nexus有156GB免费.
我能做些什么来防止这种情况发生?
2013-06-07 12:04:18 WARN [pool-1-thread-7] - org.sonatype.nexus.tasks.UpdateIndexTask - Scheduled task (UpdateIndexTask) failed :: Updating repository index "Central" from path / and below. (started 2013-06-07T12:02:26+01:00, runtime 0:01:52.193)
java.io.IOException: background merge hit exception: _a(3.6.2):C360466 _l(3.6.2):C357408 _w(3.6.2):C329033 _x(3.6.2):c32252 _y(3.6.2):c32813 _z(3.6.2):c33077 _10(3.6.2):c33145 _11(3.6.2):c32795 _12(3.6.2):c17849 into _13 [maxNumSegments=1]
at org.apache.lucene.index.IndexWriter.forceMerge(IndexWriter.java:2555) ~[na:na]
at org.apache.lucene.index.IndexWriter.optimize(IndexWriter.java:2400) ~[na:na]
at org.apache.maven.index.updater.IndexDataReader.readIndex(IndexDataReader.java:98) ~[na:na]
at org.apache.maven.index.updater.DefaultIndexUpdater.unpackIndexData(DefaultIndexUpdater.java:509) ~[na:na]
at org.apache.maven.index.updater.DefaultIndexUpdater.loadIndexDirectory(DefaultIndexUpdater.java:197) ~[na:na]
at org.apache.maven.index.updater.DefaultIndexUpdater.access$300(DefaultIndexUpdater.java:76) ~[na:na]
at org.apache.maven.index.updater.DefaultIndexUpdater$LuceneIndexAdaptor.setIndexFile(DefaultIndexUpdater.java:642) ~[na:na]
at org.apache.maven.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:862) ~[na:na]
at org.apache.maven.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:157) ~[na:na]
at org.sonatype.nexus.index.DefaultIndexerManager.updateRemoteIndex(DefaultIndexerManager.java:1311) ~[na:na]
at org.sonatype.nexus.index.DefaultIndexerManager.access$800(DefaultIndexerManager.java:186) ~[na:na] …
Run Code Online (Sandbox Code Playgroud) 我试图让 scmCommentPrefix 按照http://maven.apache.org/plugins/maven-release-plugin/faq.html#scmCommentPrefix上的文档工作
问题是,无论您添加什么前缀,都会连接到各种版本插件注释,而无需空格,因此如果我有 scmCommentPrefix=ABCD-123,则生成的注释如下所示(来自我的 dryRun 尝试):
[INFO] Full run would be checking in 3 files with message: 'ABCD-123prepare for
next development iteration'
Run Code Online (Sandbox Code Playgroud)
该文档提到您可以使用“ALT 10”或“ALT 13”在前缀中添加换行符 - 有人能给我一个工作示例吗?因为如果我在引号内添加这些字符串中的任何一个,它们就会按字面意思添加,如果我省略引号,我会收到一个 Maven 错误,抱怨 ALT 目标无效。
我正在使用命令行中的maven-dependency-plugin来下载单个文件,但是在我的本地存储库中,对于我的特定用例,我希望将它下载到当前目录.
我正在使用该插件的2.4版,它应该支持-Ddestination作为备用下载站点; 但是,我无法让它发挥作用.在调试模式下运行maven似乎表明目标参数被忽略...
我正在运行以下内容:
M:\>mvn -e -X org.apache.maven.plugins:maven-dependency-plugin:2.4:get \
-Ddestination=M:\test \
-DremoteRepositories=http://nexus-repo:8080/nexus/content/repositories/snapshots \
-Dartifact=com.company.Common:CommonLibs:1.12.0-SNAPSHOT:tar \
-Dtransitive=false
Run Code Online (Sandbox Code Playgroud)
......但得到这个......
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-dependency-plugin:2.4:get' -->
[DEBUG] (f) artifact = com.company.Common:CommonLibs:1.12.0-SNAPSHOT:tar
[DEBUG] (f) localRepository = Repository[local|file://C:\Subversion\LocalMavenRepo]
[DEBUG] (f) packaging = jar
[DEBUG] (f) pomRemoteRepositories = [Repository[central|http://repo1.maven.org/maven2]]
[DEBUG] (f) remoteRepositories = http://nexus-repo:8080/nexus/content/repositories/snapshots
[DEBUG] (f) repositoryId = temp
[DEBUG] (f) transitive = false
[DEBUG] -- end configuration --
[INFO] [dependency:get {execution: default-cli}]
[DEBUG] Skipping disabled repository central
[INFO] snapshot com.company.Common:CommonLibs:1.12.0-SNAPSHOT: checking for updates from temp
[DEBUG] …
Run Code Online (Sandbox Code Playgroud)