mojohaus / license-maven-plugin

Maven plugin to download and collect license files from project dependencies.
https://www.mojohaus.org/license-maven-plugin/
GNU Lesser General Public License v3.0
107 stars 127 forks source link

Http 429 - "Too many requests" during maven build #595

Open ChrisCreatesCoolCode opened 1 month ago

ChrisCreatesCoolCode commented 1 month ago

Hello there,

I am using your plugin in my build process. Lately I discovered that some licenses fail to download with a "429 - Too Many Requests" as shown in the image below. The rejection ultimately is decided by the server, but maybe there is a problem with the rate of requests to these servers? If so, maybe this rejection could be avoided by reducing the rate of download requests?

grafik

Best regards Christian

dade-hms commented 1 month ago

Same here, running a simple mvn org.codehaus.mojo:license-maven-plugin:2.4.0:aggregate-download-licenses image

r-sop commented 1 week ago

Same problem. Accessing the url manually works.

It also shows a lot of duplicated urls, so I think caching the response should fix this.

slawekjaranowski commented 15 hours ago

There is a class org.codehaus.mojo.license.download.Cache maybe should be improved.

Do you have an issue in single or multiple modules Maven project?

r-sop commented 3 hours ago

@slawekjaranowski For my case it's a multi-module Maven project.

Some additional information: We also use the licenseUrlReplacements, here our (cleaned up) configuration:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>license-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>aggregate-add-third-party</id>
            <goals>
                <goal>aggregate-add-third-party</goal>
            </goals>
        </execution>
        <execution>
            <id>aggregate-download-licenses</id>
            <configuration>
                <licenseUrlReplacements>
                    <licenseUrlReplacement>
                        <regexp>\Qhttps://glassfish.java.net/public/CDDL+GPL_1_1.html\E</regexp>
                        <replacement>https://oss.oracle.com/licenses/CDDL+GPL-1.1</replacement>
                    </licenseUrlReplacement>
                    <licenseUrlReplacement>
                        <regexp>\Qhttps://glassfish.dev.java.net/nonav/public/CDDL+GPL.html\E</regexp>
                        <replacement>https://oss.oracle.com/licenses/CDDL+GPL-1.1</replacement>
                    </licenseUrlReplacement>
                    <licenseUrlReplacement>
                        <regexp>\Qhttps://openjdk.java.net/legal/gplv2+ce.html\E</regexp>
                        <replacement>https://github.com/openjdk/jfx/blob/master/LICENSE</replacement>
                    </licenseUrlReplacement>
                    <licenseUrlReplacement>
                        <regexp>\Qhttps://glassfish.dev.java.net/public/CDDLv1.0.html\E</regexp>
                        <replacement>https://javaee.github.io/LICENSE</replacement>
                    </licenseUrlReplacement>
                    <licenseUrlReplacement>
                        <regexp>\Qhttp://opensource.org/licenses/mit-license\E</regexp>
                        <replacement>https://opensource.org/license/mit</replacement>
                    </licenseUrlReplacement>
                </licenseUrlReplacements>
            </configuration>
            <goals>
                <goal>aggregate-download-licenses</goal>
            </goals>
        </execution>
    </executions>
</plugin>