authlete / sd-jwt

A Java library for the "Selective Disclosure for JWTs (SD-JWT)" specification.
https://www.authlete.com/
Apache License 2.0
23 stars 0 forks source link

Could not find artifact org.sonatype.nexus:nexus-plugins:jar:2.2.1 in central maven repository #2

Closed parvparikh closed 6 months ago

parvparikh commented 6 months ago

Description: When attempting to build my project using Maven, I encountered an error indicating that the artifact org.sonatype.nexus:nexus-plugins:jar:2.2.1 could not be found in the central repository. This prevents the build from completing successfully.

Steps to Reproduce: Clone the project repository. Navigate to the project directory. Run the Maven build command: mvn clean install -X. Expected Behavior: The build should complete successfully, with all dependencies being resolved and downloaded as needed. Actual Behavior: The build fails with the following error message:

Could not find artifact org.sonatype.nexus:nexus-plugins:jar:2.2.1 in central (https://repo.maven.apache.org/maven2)

TakahikoKawasaki commented 6 months ago

org.sonatype.next:nexus-plugins is found here: https://repo.maven.apache.org/maven2/org/sonatype/nexus/nexus-plugins/2.2.1/

but it does not have a JAR file, because its packaging is not jar but pom.

I have used the same pom.xml structure not only for this repository but for other repositories for years, and I've never encountered this issue. Could you try to find the reason why your environment is trying to refer to org.sonatype.nexus:nexus-plugins:jar:2.2.1?

parvparikh commented 6 months ago

Thank you for your prompt response and support in resolving the nexus-plugin issue. While I couldn't pinpoint the exact cause of the initial problem, the sonatype-nexus-plugins is now functioning correctly after implementing the changes you suggested. I appreciate your assistance and will reach out again if any other issues arise. This library will be incredibly helpful for my project.

Additionally, I encountered a related build issue that required setting up GPG keys. Here’s a detailed account of the steps I took, which might be helpful to include in the README file to assist others who might encounter similar issues:

--> Download and Install Gpg4win:

I downloaded Gpg4win from Gpg4win's official website. Installed it on my system following the on-screen instructions.

--> Generate GPG Keys:

Opened the command prompt and ran gpg --gen-key. Followed the prompts to enter my real name and email address:

Real name: (name)
Email address: (email)

Selected "O" (Okay) to confirm the details. To view the generated keys, I used gpg --list-keys, which showed the info for the key

--> Update Maven GPG Plugin Configuration:

I updated the pom.xml file to include the GPG plugin configuration:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-gpg-plugin</artifactId>
    <version>3.0.1</version>
    <executions>
        <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals>
                <goal>sign</goal>
            </goals>
            <configuration>
                <keyname>KEY_NAME</keyname>
            </configuration>
        </execution>
    </executions>
</plugin>

--> Passphrase Configuration:

When prompted for the GPG passphrase during the Maven build process, I entered the passphrase that I set up during key generation.

These steps resolved the GPG-related issues, allowing the build to complete successfully. Including these instructions in the README file would greatly benefit users who might face similar challenges.

Thank you once again for your assistance.