我正在一个多模块项目上使用Maven 3.2.3。 我想生成检查样式和查找错误报告,因此我配置了以下内容:
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.13</version>
<reportSets>
<reportSet>
<reports>
<report>checkstyle</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.5.5</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.3</version>
</plugin>
</plugins>
</reporting>
但是,当我跑步时
mvn site:site site:deploy
我反复收到以下警告...
[WARNING] The repository url 'https://maven-repository.dev.java.net/nonav/repository' is invalid - Repository 'java.net' will be blacklisted.
我的pom.xml文件或我的~/.m2/settings.xml文件中都没有引用这个存储库。 如何跟踪此问题并最终解决警告?
您必须配置报告插件,以便它在构建报告时不会寻找存储库。在 You Pom 中添加以下内容:
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.8</version>
<configuration>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
</configuration>
</plugin>
</plugins>
</reporting>
即使您没有在私有或全局 maven 设置或任何父 pom 中设置"无效"存储库,报告插件也会引发警告。也许插件还会在项目的依赖项中查找存储库定义。
[WARNING] The repository url 'https://maven-repository.dev.java.net/nonav/repository' is invalid - Repository 'java.net' will be blacklisted.
[WARNING] The repository url 'http://maven.glassfish.org/content/groups/glassfish' is invalid - Repository 'glassfish-repo-archive' will be blacklisted.
[WARNING] The repository url 'https://maven.java.net/content/repositories/releases/' is invalid - Repository 'jvnet-nexus-releases' will be blacklisted.
[WARNING] The repository url 'https://maven.java.net/content/groups/public' is invalid - Repository 'release.maven.java.net' will be blacklisted.
[WARNING] The repository url 'http://repository.springsource.com/maven/bundles/external' is invalid - Repository 'spring-external' will be blacklisted.
我有 maven 项目,其中聚合与继承分开:Maven 模块继承与聚合。挨次
mvn project-info-reports:dependencies
作品,聚合pom
必须继承parent
。为避免将存储库警告列入黑名单,必须按如下所述配置父reporting
,或者可能很简单:
<properties>
...
<dependency.locations.enabled>false</dependency.locations.enabled>
</properties>