19

I’m using Maven 3.2.3 on a multi-module project. I want to generate a checkstyle and findbugs report, so I have configured the following:

    <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>

However, when I run

mvn site:site site:deploy

I repeatedly get the following warning …

[WARNING] The repository url 'https://maven-repository.dev.java.net/nonav/repository' is invalid - Repository 'java.net' will be blacklisted.

I have no reference to this repo in either my pom.xml files or my ~/.m2/settings.xml file. How can I track this down and ultimately resolve the warning?

Dave A
  • 2,780
  • 9
  • 41
  • 60
  • This can be somewhere in a parent or can be defined in your `settings.xml`. Furthermore if you like to create a site and deploy it the best is to use `mvn site-deploy` instead of the `site:site`, `site:deploy` – khmarbaise Jan 23 '15 at 07:33
  • 1
    As I said, I can't find any reference to this in my pom.xml files or my ~/.m2/settings.xml file (I put this comment at the end of the question so you may have missed that). Anyway, good to know about the site-deploy thing. – Dave A Jan 23 '15 at 15:08

2 Answers2

21

You have to configure the reporting plugin, so that it does not look for repositories, as it builts the report. in you pom add the following:

<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>

The reporting plugin throws the Warning even if you do not have set in your private or global maven settings or in any parent pom the "invalid" repositories. Maybe the plugin looks also for repository definitions in the dependencies of the project.

[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.
Andreas Panagiotidis
  • 2,763
  • 35
  • 32
  • Works for me. Add this configuration suppress this warnings: `[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.` – Thiago Pereira Dec 16 '15 at 17:05
  • 1
    Where is the offending repo defined? Just installed a fresh maven and I'm getting this error. – Friso Oct 13 '16 at 11:12
5

I have maven project, where aggregation separate from inheritance: maven module inheritance vs aggregation. In order

mvn project-info-reports:dependencies

works, aggregate pom must inherit parent. To avoid blacklisted repository warnings, parent reporting must be configured as below mentioned, or it could be simple:

<properties>
    ...
    <dependency.locations.enabled>false</dependency.locations.enabled>
</properties>
Grigory Kislin
  • 16,647
  • 10
  • 125
  • 197