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

Question: Classifier-Support #224

Closed
MarcDahlem opened this issue Apr 17, 2018 · 5 comments
Closed

Question: Classifier-Support #224

MarcDahlem opened this issue Apr 17, 2018 · 5 comments

Comments

@MarcDahlem
Copy link

Hi Ben-Manes,

is there a support for classifiers?

We have some internal libraries which are published only via classifier.
Their versions do not update correctly during the dU-task.

Furthermore, is there a possibility to get the extension provided by the dependency (e.g. '@zip').

Thanks & BR

@ben-manes
Copy link
Owner

We script Gradle so the behavior should conform to what their APIs provide. There isn't any logic around classifiers in the plugin, and I don't see it or extensions exposed by many of the dependency apis (e.g. resolution rules). So I don't think Gradle offers a lot of visibility during resolution.

The plugin is effectively resolving with,

project.dependencies.create("${dependency.group}:${dependency.name}:+") {
    transitive = false
}

which means it does not capture your classifier. The ExternalDependency doesn't provide that level of detail for us to include.

You might need to ask the Gradle team. If there is an enhancement we can add it, but I'm not sure about what we'd do here.

@vanniktech
Copy link
Contributor

@MarcDahlem has the question been answered?

@MarcDahlem
Copy link
Author

Oh sry, I did not find the time to llok into your code. I wanted to test + submit pull request if the following works:

Instead of

project.dependencies.create("${dependency.group}:${dependency.name}:+") {
transitive = false
}

we could use propably

project.dependencies.create("${dependency.group}:${dependency.name}:+:${dependency.classifier}@${dependency.ext}") {
transitive = false
}

Of course, the classifier and ext should only be added if they exist in the dependency (dependency.classifier != null or so).

@ben-manes
Copy link
Owner

@MarcDahlem the classifier and extension are not part of the ExternalDependency api. I don't know how we can query for them.

@ben-manes
Copy link
Owner

Oh, it's in the artifact.

dependencies.create("a:b:+:test@jar").artifacts.each { art ->
  println "${art.extension} - ${art.classifier}"
}

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

No branches or pull requests

3 participants