Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slf4j metadata are fetched in each maven command #2106

Closed
mmaeller opened this issue Feb 27, 2024 · 4 comments
Closed

Slf4j metadata are fetched in each maven command #2106

mmaeller opened this issue Feb 27, 2024 · 4 comments
Labels
Milestone

Comments

@mmaeller
Copy link

Describe the bug
It seems like #1909 is not fully fixed yet.
The plugin tries to download slf4j metadata on every maven command.

[INFO] Scanning for projects...
Downloading from spring-releases: https://repo.spring.io/release/org/slf4j/slf4j-api/maven-metadata.xml
[WARNING] Could not transfer metadata org.slf4j:slf4j-api/maven-metadata.xml from/to spring-releases (https://repo.spring.io/release): status code: 401, reason phrase:  (401)
[WARNING] org.slf4j:slf4j-api/maven-metadata.xml failed to transfer from https://repo.spring.io/release during a previous attempt. This failure was cached in the local repository and resolution will not be reattempted until the update interval of spring-releases has elapsed or updates are forced. Original error: Could not transfer metadata org.slf4j:slf4j-api/maven-metadata.xml from/to spring-releases (https://repo.spring.io/release): status code: 401, reason phrase:  (401)
[WARNING] org.slf4j:slf4j-api/maven-metadata.xml failed to transfer from https://repo.spring.io/release during a previous attempt. This failure was cached in the local repository and resolution will not be reattempted until the update interval of spring-releases has elapsed or updates are forced. Original error: Could not transfer metadata org.slf4j:slf4j-api/maven-metadata.xml from/to spring-releases (https://repo.spring.io/release): status code: 401, reason phrase:  (401)
[WARNING] org.slf4j:slf4j-api/maven-metadata.xml failed to transfer from https://repo.spring.io/release during a previous attempt. This failure was cached in the local repository and resolution will not be reattempted until the update interval of spring-releases has elapsed or updates are forced. Original error: Could not transfer metadata org.slf4j:slf4j-api/maven-metadata.xml from/to spring-releases (https://repo.spring.io/release): status code: 401, reason phrase:  (401)
[WARNING] org.slf4j:slf4j-api/maven-metadata.xml failed to transfer from https://repo.spring.io/release during a previous attempt. This failure was cached in the local repository and resolution will not be reattempted until the update interval of spring-releases has elapsed or updates are forced. Original error: Could not transfer metadata org.slf4j:slf4j-api/maven-metadata.xml from/to spring-releases (https://repo.spring.io/release): status code: 401, reason phrase:  (401)
[WARNING] org.slf4j:slf4j-api/maven-metadata.xml failed to transfer from https://repo.spring.io/release during a previous attempt. This failure was cached in the local repository and resolution will not be reattempted until the update interval of spring-releases has elapsed or updates are forced. Original error: Could not transfer metadata org.slf4j:slf4j-api/maven-metadata.xml from/to spring-releases (https://repo.spring.io/release): status code: 401, reason phrase:  (401)
[WARNING] Could not transfer metadata org.slf4j:slf4j-api/maven-metadata.xml from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [apache.snapshots (http://repository.apache.org/snapshots, default, snapshots)]

When I comment out the plugin the warnings disappear.

Sample

    <repositories>
        <repository>
            <id>nexus-maven</id>
            <name>nexus</name>
            <url>https://some.nexus/repository/</url>
        </repository>
    </repositories>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-contract-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <testFramework>JUNIT5</testFramework>
                    <packageWithBaseClasses>com.contract.provider</packageWithBaseClasses>
                </configuration>
            </plugin>
        </plugins>
    </build>

When I add additional pluginRepository configuration it doesn't make any difference.

@mmaeller mmaeller changed the title Slf4j metada are fetch in each maven command Slf4j metadata are fetch in each maven command Feb 27, 2024
@mmaeller mmaeller changed the title Slf4j metadata are fetch in each maven command Slf4j metadata are fetched in each maven command Feb 27, 2024
@hellproxy
Copy link

I also recently encountered this. Adding the following to your pom.xml should prevent these downloads from being attempted.

<pluginRepositories>
    <pluginRepository>
        <id>spring-releases</id>
        <name>Spring Releases</name>
        <url>https://repo.spring.io/release</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <releases>
            <enabled>false</enabled>
        </releases>
    </pluginRepository>
</pluginRepositories>

This Spring blog post explains that connections shouldn't generally be made to https://repo.spring.io/release:

Anonymous clients querying /release, /libs-release, /libs-milestone /libs-snapshot, /plugins-release, or any other virtual repository may be denied. If requests persist, their senders will risk being banned.

@marcingrzejszczak
Copy link
Contributor

I'll look into it again. Thanks for the issue

@marwin1991
Copy link

@marcingrzejszczak which version will include this fix?

@marcingrzejszczak marcingrzejszczak added this to the 4.1.3 milestone May 28, 2024
@marcingrzejszczak
Copy link
Contributor

4.1.3, I've updated the milestone on this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants