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

Fix snapshot dependency resolution #1884

Merged
merged 10 commits into from
Jul 27, 2023

Conversation

denisrosca
Copy link
Contributor

@denisrosca denisrosca commented Jul 26, 2023

*Closes #1883 *

Description of changes:
Add an optional id for the maven repository definition.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@@ -96,11 +96,11 @@ public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable except
public void addRepository(MavenRepository repository) {
try {
URI uri = new URI(repository.getUrl());
String name = uri.getHost();
String id = repository.getId().orElseGet(() -> uri.getHost());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: now that I think of it, perhaps we could default to the index instead (in the list of available repos)? That way it's still going to be unique.

Copy link
Member

@mtdowling mtdowling Jul 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should work. Maybe something like index + "|" + uri.getHost() for better logs/debugging? Something like "|" can't be used in host, so shouldn't be ambiguous in any scenario.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.
Index starts at 1, let me know if you want to bikeshed 😄

@jvschneid jvschneid merged commit 6ce8de0 into smithy-lang:main Jul 27, 2023
10 checks passed
syall pushed a commit to Xtansia/smithy that referenced this pull request Aug 11, 2023
alextwoods pushed a commit to alextwoods/smithy that referenced this pull request Sep 15, 2023
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

Successfully merging this pull request may close these issues.

Resolution for snapshot artifacts is broken when defining multiple repositories with the same hostname
4 participants