-
Notifications
You must be signed in to change notification settings - Fork 218
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
Fix snapshot dependency resolution #1884
Conversation
smithy-build/src/main/java/software/amazon/smithy/build/model/MavenRepository.java
Outdated
Show resolved
Hide resolved
smithy-build/src/main/java/software/amazon/smithy/build/model/MavenRepository.java
Outdated
Show resolved
Hide resolved
smithy-build/src/main/java/software/amazon/smithy/build/model/MavenRepository.java
Outdated
Show resolved
Hide resolved
smithy-cli/src/it/java/software/amazon/smithy/cli/MavenResolverMultipleReposTest.java
Outdated
Show resolved
Hide resolved
@@ -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()); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 😄
smithy-build/src/main/java/software/amazon/smithy/build/model/MavenRepository.java
Outdated
Show resolved
Hide resolved
dd0df29
to
2f48eee
Compare
2a8d9de
to
3b175ae
Compare
*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.