jonesbusy / oras-java

Apache License 2.0
2 stars 1 forks source link

Failed to install dep with command: mvn install #32

Open LinuxSuRen opened 2 days ago

LinuxSuRen commented 2 days ago
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.xxx</groupId>
    <artifactId>xxx</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>land.oras.java</groupId>
            <artifactId>oras-java-sdk</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>github</id>
            <name>ORAS Java GitHub packages</name>
            <url>https://maven.pkg.github.com/jonesbusy/oras-java</url>
        </repository>
    </repositories>
</project>

Above is the pom.xml file in my project, I got the following errors when run command mvn install:

Downloading from github: https://maven.pkg.github.com/jonesbusy/oras-java/land/oras/java/oras-java-sdk/0.0.1-SNAPSHOT/oras-java-sdk-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.802 s
[INFO] Finished at: 2024-10-24T08:37:21Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project aioss-package-mgr: Could not resolve dependencies for project com.ailinking.cnms:aioss-package-mgr:jar:1.0-SNAPSHOT: Failed to collect dependencies at land.oras.java:oras-java-sdk:jar:0.0.1-SNAPSHOT: Failed to read artifact descriptor for land.oras.java:oras-java-sdk:jar:0.0.1-SNAPSHOT: Could not transfer artifact land.oras.java:oras-java-sdk:pom:0.0.1-SNAPSHOT from/to github (https://maven.pkg.github.com/jonesbusy/oras-java): Authentication failed for https://maven.pkg.github.com/jonesbusy/oras-java/land/oras/java/oras-java-sdk/0.0.1-SNAPSHOT/oras-java-sdk-0.0.1-SNAPSHOT.pom 401 Unauthorized -> [Help 1]

Please feel free to let me know if I missed anything. And thanks for your time.

jonesbusy commented 2 days ago

Hi,

This is the pom I used to interactively test the library: https://github.com/jonesbusy/oras-java-cli/blob/main/pom.xml#L56

Perhaps the ?

<snapshots>
     <enabled>true</enabled>
</snapshots>

I suggest also Java 17 and Maven 3.9.9 to isolate any outdated dependency.

LinuxSuRen commented 2 days ago

Thanks for your quick response. Currently, we still use Java 8. So, I need to figure out how to use oras-java in my project.