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

The way ivy.xml files are found is not robust #755

Closed
benjyw opened this issue Jan 26, 2018 · 1 comment · Fixed by #1166
Closed

The way ivy.xml files are found is not robust #755

benjyw opened this issue Jan 26, 2018 · 1 comment · Fixed by #1166

Comments

@benjyw
Copy link

benjyw commented Jan 26, 2018

Ivy URL/Filesystem repos have separate patterns for finding ivy.xml files vs. finding artifacts.

E.g.,

<url>
  <ivy pattern="http://foo.com/[module]/[revision]/ivy.xml" />
  <artifact pattern="http://foo.com/[module]/[revision]/[artifact]-[revision].[ext]" />
</url>

Coursier, however, appears to expect to find an artifact and its accompanying ivy.xml using the same pattern (with artifact="ivy" and ext="xml"). This means that in practice all patterns must end with /[artifact].[ext], or the ivy.xml files must have non-standard names.

This can lead to weird behavior, such as attempting to parse a .jar file as XML (e.g., if the pattern ends with [module]-[revision].jar because the author doesn't care about the ivy.xml at all, see #754)

Update: I guess my statement that Coursier "appears to expect to find an artifact and its accompanying ivy.xml using the same pattern" is inaccurate, since it can find each using a separate pattern, I think. But there still remains the problem that in some cases it can match on a file that isn't an ivy.xml file, but will still attempt to parse it as XML. That said, in practice, resolving #754 would solve the current issues I'm having. The rest could be worked around with careful use of patterns.

@alexarchambault
Copy link
Member

Having different patterns for metadata and artifacts is supported when using coursier via its API or its sbt plugin, but not via the CLI. But that should easy to add, one has just to find a right syntax for that… (and handle it around that line)

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

Successfully merging a pull request may close this issue.

2 participants