zolyfarkas / spf4j

Simple performance framework for java
http://www.spf4j.org
207 stars 32 forks source link

Can't download dependency avro-1.10.0.2p #60

Open msvticket opened 3 years ago

msvticket commented 3 years ago

When trying to use spf4j-slf4j-test by adding

        <dependency>
            <groupId>org.spf4j</groupId>
            <artifactId>spf4j-slf4j-test</artifactId>
            <scope>test</scope>
            <version>8.9.1</version>
        </dependency>

to my pom.xml I get the following error when running mvn: Caused by: org.apache.maven.wagon.authorization.AuthorizationException: authentication failed for https://maven.pkg.github.com/zolyfarkas/*/org/apache/avro/avro/1.10.0.2p/avro-1.10.0.2p.pom, status: 401 Unauthorized

I have verified that trying to download the file with curl also gives status 401 Unauthorized.

zolyfarkas commented 3 years ago

HI Marten, that is because /avro-1.10.0.2p is being published to a githup repo. And unfortunately github still requires authentication.

you can use it by adding the repositories to your pom.xml (https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry https://docs.github.com/en/packages/guides/configuring-apache-maven-for-use-with-github-packages for more info):

    <repositories>
      <repository>
        <id>github</id>
        <url>https://maven.pkg.github.com/zolyfarkas/*</url>
        <snapshots>
          <enabled>true</enabled>
        </snapshots>
      </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
          <id>github</id>
          <url>https://maven.pkg.github.com/zolyfarkas/*</url>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </pluginRepository>
    </pluginRepositories>

The packages are public.

I thought GITHUB will remove this requirement by this time, (https://github.community/t/download-from-github-package-registry-without-authentication/14407)

I will get a new new version out that will not depend on github packages artifacts sometime this week.

until then with the config I meantioned you should be able to make this work.

thanks!

—Z

On Sep 22, 2021, at 6:07 AM, Mårten Svantesson @.***> wrote:

When trying to use spf4j-slf4j-test by adding

  <dependency>
      <groupId>org.spf4j</groupId>
      <artifactId>spf4j-slf4j-test</artifactId>
      <scope>test</scope>
      <version>8.9.1</version>
  </dependency>

to my pom.xml I get the following error when running mvn: Caused by: org.apache.maven.wagon.authorization.AuthorizationException: authentication failed for https://maven.pkg.github.com/zolyfarkas/*/org/apache/avro/avro/1.10.0.2p/avro-1.10.0.2p.pom, status: 401 Unauthorized

I have verified that trying to download the file with curl also gives status 401 Unauthorized.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/zolyfarkas/spf4j/issues/60, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABDFVKTSVGAOEHXQCQEQQTUDGTHZANCNFSM5EQ6BSLA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

zolyfarkas commented 3 years ago

I have release version 8.9.2 today that shoud have only dependencies to maven central (not github packages).

let me know if that works for you

thanks!

--Z

On Sep 22, 2021, at 6:07 AM, Mårten Svantesson @.***> wrote:

When trying to use spf4j-slf4j-test by adding

  <dependency>
      <groupId>org.spf4j</groupId>
      <artifactId>spf4j-slf4j-test</artifactId>
      <scope>test</scope>
      <version>8.9.1</version>
  </dependency>

to my pom.xml I get the following error when running mvn: Caused by: org.apache.maven.wagon.authorization.AuthorizationException: authentication failed for https://maven.pkg.github.com/zolyfarkas/*/org/apache/avro/avro/1.10.0.2p/avro-1.10.0.2p.pom, status: 401 Unauthorized

I have verified that trying to download the file with curl also gives status 401 Unauthorized.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/zolyfarkas/spf4j/issues/60, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABDFVKTSVGAOEHXQCQEQQTUDGTHZANCNFSM5EQ6BSLA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

msvticket commented 2 years ago

I now got around to try again. It still doesn't work. I have tried versions 8.9.2 and 8.9.4:

Could not transfer artifact org.apache.avro:avro:pom:1.10.0.8p from/to github (https://maven.pkg.github.com/zolyfarkas/): authentication failed for https://maven.pkg.github.com/zolyfarkas//org/apache/avro/avro/1.10.0.8p/avro-1.10.0.8p.pom, status: 401 Unauthorized

zolyfarkas commented 2 years ago

@msvticket Sorry for the inconvenience.

I removed the requirement only for spf4j-slf4j-test, so I guess it is pulled by another spf4j lib.

You could try to overwrite the avro version by using in your dependencyManagement section of your pom:

<dependency>
  <groupId>org.apache.avro</groupId>
  <artifactId>avro</artifactId>
  <version>1.10.2</version>
</dependency>

use 8.9.4 if you do this.

My hope was for github to remove this nonsensical auth requirement sooner rather than later, so that I don't have to do extra work.

did you try to configure authentication?

msvticket commented 2 years ago

Something like that. From the stacktrace of the error:

Failed to collect dependencies at org.spf4j:spf4j-slf4j-test:jar:8.9.4 -> org.spf4j.avro:core-schema:jar:1.0.7 -> org.apache.avro:avro:jar:1.10.0.8p

Adding the snippet to dependencyManagement worked though.

I didn't try to configure authentication since I don't want the hassle with adding credentials to a build pipeline in a secure way.

senderic commented 2 years ago

See my comment here (its unfortunately in a closed issue) https://github.com/zolyfarkas/spf4j/issues/56#issuecomment-1058756009

I'll post it here as well:

Would you consider uploading it to https://jitpack.io/ instead? It is free for opensource and there are no authentication steps to deal with (we just need to reference jitpack in the POM as a repository).

Those steps of making a token are just a bit excessive, makes each system I work with needing an extra step, etc.

Another open source project I work with that uses this (in case you wanted to see an example): https://jitpack.io/#Juniper/netconf-java https://github.com/Juniper/netconf-java

As you can see, the tags form the version.

sfc-gh-schen commented 2 years ago

@zolyfarkas Can you remove the requirement for spf4j-ui? I overwrite the avro in my pom.xml, how ever, when I execute the spf4j-ui jar, it throws errors Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "AWT-EventQueue-0"

zolyfarkas commented 2 years ago

will switch to https://jitpack.io/ I was waiting for github to remove the auth requirements as they promised, but I guess that will not happen.

dkapil commented 1 year ago

Hi @zolyfarkas We are unable to resolve this issue if we keep the latest versions of spf4j and spf4j-ui and downgrade the version of Avro to 1.10.2 by declaring it specifically in dependencies.

We are getting the error as mentioned by @sfc-gh-schen Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "AWT-EventQueue-0"

If we can not keep our Github credentials in the repo since it is a public one to fetch the latest version of Avro, is there a workaround we can make spf4j-ui work with old version of Avro?

zolyfarkas commented 1 year ago

@dkapil spf4j should work with the public version of avro as well.

If you can share the complete stack trace it would help me understand the error you are encountering.

thanks!

soloturn commented 3 months ago

@zolyfarkas i get:

Could not find org.spf4j:avro-logical-types-gen:1.3. Searched in the following locations:

zolyfarkas commented 3 months ago

Yeah, looks like that library somehow failed to publish to maven central, I have just republished it. Please let me know if anything else is missing.