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

mavenLocal() ignored when resolving dependencies #108

Closed
cplerch opened this issue Mar 4, 2018 · 6 comments
Closed

mavenLocal() ignored when resolving dependencies #108

cplerch opened this issue Mar 4, 2018 · 6 comments

Comments

@cplerch
Copy link

cplerch commented Mar 4, 2018

What needs to be configured for searching mavenLocal first when resolving dependencies?
I've tried to specify a dependency which is only present in my local maven repo, but it didn't get resolved.
Error msg:

[kscript] Resolving dependencies...[kscript] 
[ERROR] Failed to lookup dependencies. Check dependency locators or file a bug on https://github.com/holgerbrandl/kscript
[kscript] The error reported by maven was:
[kscript] [mvn]
[kscript] Generated pom file was:

<?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>kscript</groupId>
    <artifactId>maven_template</artifactId>
    <version>1.0</version>
     <repositories>
        <repository>
            <id>jcenter</id>
            <url>http://jcenter.bintray.com/</url>
        </repository>
    </repositories>
    <dependencies>
    <dependency>
            <groupId>eu.km-works.util</groupId>
            <artifactId>utils-fs</artifactId>
            <version>2.0.0</version>
    </dependency>
    </dependencies>
</project>

What does it mean (line 2 of error message):
Check dependency locators...

@cplerch cplerch changed the title mavanLocal() ignored when resolving dependencies mavenLocal() ignored when resolving dependencies Mar 4, 2018
@holgerbrandl
Copy link
Collaborator

It means, that you may want to check the dependency declarations in your script for typos, version-mistakes, etc.

To debug the issue you could run mvn dependency:copy-dependencies over the generated pom manually to check what goes wrong. Simply paste the printed out pom from above into a pom.xml and run the cmd.

@MikeMitterer
Copy link

I had a similar problem because I defined a wildcard version...

//DEPS at.mikemitterer:builddart:0.+

which produced the following error message

[kscript] Resolving dependencies...Failed to lookup dependencies. Maven reported the following error:
[ERROR] Failed to execute goal on project maven_template: Could not resolve dependencies for project kscript:maven_template:jar:1.0: Failure to find at.mikemitterer:builddart:jar:0.+ in http://jcenter.bintray.com/ was cached in the local repository, resolution will not be reattempted until the update interval of jcenter has elapsed or updates are forced -> [Help 1]

After defining the full version //DEPS at.mikemitterer:builddart:0.0.1 it works

@holgerbrandl
Copy link
Collaborator

Do you know if maven itself is able to resolve wildcards dependencies?

@MikeMitterer
Copy link

Hmmm - I haven't used Maven since I moved to Gradle (x years ago) but I don't think they support wildcards. As far as I know they had just LATEST | RELEASE keywords and then they dropped those KW in 3.0

@holgerbrandl
Copy link
Collaborator

Maven seems to support version ranges, so maybe this would work?

@holgerbrandl
Copy link
Collaborator

Duplicate of #166

@holgerbrandl holgerbrandl marked this as a duplicate of #166 Oct 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants