Skip to content

Fix snapshot dependency resolution#1884

Merged
jvschneid merged 10 commits intosmithy-lang:mainfrom
denisrosca:hostname-multiple-resolvers
Jul 27, 2023
Merged

Fix snapshot dependency resolution#1884
jvschneid merged 10 commits intosmithy-lang:mainfrom
denisrosca:hostname-multiple-resolvers

Conversation

@denisrosca
Copy link
Copy Markdown
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.

try {
URI uri = new URI(repository.getUrl());
String name = uri.getHost();
String id = repository.getId().orElseGet(() -> uri.getHost());
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 😄

@denisrosca denisrosca force-pushed the hostname-multiple-resolvers branch from dd0df29 to 2f48eee Compare July 27, 2023 09:34
@denisrosca denisrosca force-pushed the hostname-multiple-resolvers branch from 2a8d9de to 3b175ae Compare July 27, 2023 11:39
@jvschneid jvschneid merged commit 6ce8de0 into smithy-lang:main Jul 27, 2023
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