Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to resolve dependencies from a Nexus private repo #301

Open
luciano-fiandesio opened this issue Jan 21, 2021 · 3 comments
Open

Unable to resolve dependencies from a Nexus private repo #301

luciano-fiandesio opened this issue Jan 21, 2021 · 3 comments
Labels

Comments

@luciano-fiandesio
Copy link

luciano-fiandesio commented Jan 21, 2021

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?

@holgerbrandl
Copy link
Collaborator

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

@luciano-fiandesio
Copy link
Author

luciano-fiandesio commented Jan 22, 2021

@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.

@holgerbrandl
Copy link
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
Labels
Projects
None yet
Development

No branches or pull requests

2 participants