Maven站点警告:存储库URL“https://maven-repository.dev.java.net/nonav/repository”无效

时间:2015-01-22 20:59:55

标签: maven url repository maven-site-plugin

我在多模块项目中使用Maven 3.2.3。我想生成一个checkstyle和findbugs报告,所以我配置了以下内容:

    <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文件中没有引用此repo。如何跟踪此问题并最终解决警告?

2 个答案:

答案 0 :(得分:21)

您必须配置报告插件,以便它不会查找存储库,因为它会构建报告。 在你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.

答案 1 :(得分:3)

我有maven项目,其中聚合与继承分开: maven module inheritance vs aggregation

mvn project-info-reports:dependencies

有效,汇总pom必须继承parent。 要避免列入黑名单的存储库警告,必须按上述方式配置父reporting,否则它可能很简单:

<properties>
    ...
    <dependency.locations.enabled>false</dependency.locations.enabled>
</properties>