【问题标题】:Maven site warning: The repository url 'https://maven-repository.dev.java.net/nonav/repository' is invalidMaven 站点警告:存储库 url 'https://maven-repository.dev.java.net/nonav/repository' 无效
【发布时间】:2015-01-22 20:59:54
【问题描述】:

我在一个多模块项目中使用 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。我怎样才能追踪到这一点并最终解决警告?

【问题讨论】:

  • 这可以在父母的某个地方,也可以在您的settings.xml 中定义。此外,如果您想创建一个站点并进行部署,最好使用mvn site-deploy 而不是site:sitesite:deploy
  • 正如我所说,我在我的 pom.xml 文件或 ~/.m2/settings.xml 文件中找不到对此的任何引用(我将此评论放在问题的末尾,所以你可能错过了)。无论如何,很高兴了解站点部署的事情。

标签: maven url repository maven-site-plugin


【解决方案1】:

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

【讨论】:

  • 为我工作。添加此配置抑制此警告:[WARNING] The repository url 'http://download.java.net/maven/2' is invalid - Repository 'maven2-repository.dev.java.net' will be blacklisted.[WARNING] The repository url 'http://download.java.net/maven/glassfish' is invalid - Repository 'glassfish-repository' will be blacklisted.
  • 有问题的 repo 定义在哪里?刚刚安装了一个新的 Maven,我收到了这个错误。
【解决方案2】:

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

mvn project-info-reports:dependencies

有效,聚合 pom 必须继承 parent。 为了避免列入黑名单的仓库警告,父 reporting 必须按如下所述进行配置,或者很简单:

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

【讨论】:

    猜你喜欢
    • 2013-05-25
    • 1970-01-01
    • 1970-01-01
    • 2019-03-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-28
    • 2012-08-17
    • 2011-11-06
    相关资源
    最近更新 更多