Skip to content

Unable to resolve dependencies from a Nexus private repo #301

Description

@luciano-fiandesio

Hello, I'm trying to pull dependencies from a private repo using kscript 3.0.2.

I use the approach specified in the documentation:

@file:MavenRepository("acme", "https://nexus.mycompany.com/repository/maven-releases" , user="myuser", password="mypasswrd" )
@file:DependsOn("acme:acme-common:1.1.1")

or

@file:MavenRepository("acme", "https://nexus.mycompany.com/repository/maven-releases" )
@file:DependsOn("acme:acme-common:1.1.1")

and using a settings.xml file in my .m2 folder:

<?xml version="1.0"?>
<settings>
    <servers>
        <server>
            <id>acme</id>
            <username>myuser</username>
            <password>mypassword</password>
        </server>
    </servers>
</settings>

Both approaches do not seem to work. I get this error:

[kscript] Resolving dependencies...
[kscript] Resolving acme:acme-common:1.1.1...
[kscript] [ERROR] Failed while connecting to the server. Check the connection (http/https, port, proxy, credentials, etc.) of your maven dependency locators. If you suspect this is a bug, you can create an issue on https://github.com/holgerbrandl/kscript
[kscript] [ERROR] Exception: java.lang.RuntimeException: File 'acme:acme-common:1.1.1' not found
org.eclipse.aether.resolution.DependencyResolutionException: The following artifacts could not be resolved: 
...

Any idea?

Activity

  1. holgerbrandl commented on Jan 21, 2021

    @holgerbrandl
    Collaborator

    Did this work with kscript 2.x? The dependency resolver changed with 3.x and it could be a regresssion.

  2. luciano-fiandesio commented on Jan 22, 2021

    @luciano-fiandesio
    Author

    @holgerbrandl no, it did not. I tried with kscript 2.9.3.
    I had a different error (#239). Perhaps I should try with 2.9.3 and jdk8, but even if that would work, it would not be a viable solution for me.

    Note that the script I wrote declares other dependencies which are public, and these are fetched ok. The problem seems to be only related to private repos.

  3. holgerbrandl commented on Apr 23, 2021

    @holgerbrandl
    Collaborator

    I've tried and it works by just providing the @file:MavenRepositor annotation with my nexus credentials.

    System settings

    Version   : v3.0.2
    Website   : https://github.com/holgerbrandl/kscript
    Kotlin    : 1.4.30-release-302
    Java      : JRE 1.8.0_191
    

    Any comments/ideas which would help me reproducing the bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions