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

deduplicate error while assembling project with swagger-parser dependency in it. #2126

Closed
philemone opened this issue Oct 11, 2024 · 3 comments
Labels

Comments

@philemone
Copy link

Hi guys.

I've recently updated swagger-parser from 2.1.15 to 2.1.22 and found out there is an error while trying to assembly project with swagger-parser dependency.

To reproduce error all you have to do is create empty project (I've used empty scala project), add swagger-parser as dependency and try to assembly it (I've used sbt assembly). In swagger-parser library there are classes with the same name but somehow different - so it is not clear which class should be used.

[error] /user/.cache/coursier/v1/https/repo1.maven.org/maven2/io/swagger/parser/v3/swagger-parser-safe-url-resolver/2.1.22/swagger-parser-safe-url-resolver-2.1.22.jar:io/swagger/v3/parser/urlresolver/PermittedUrlsChecker.class
[error] /user/.cache/coursier/v1/https/repo1.maven.org/maven2/io/swagger/swagger-parser-safe-url-resolver/1.0.70/swagger-parser-safe-url-resolver-1.0.70.jar:io/swagger/v3/parser/urlresolver/PermittedUrlsChecker.class

[error] deduplicate: different file contents found in the following:
[error] /user/.cache/coursier/v1/https/repo1.maven.org/maven2/io/swagger/parser/v3/swagger-parser-safe-url-resolver/2.1.22/swagger-parser-safe-url-resolver-2.1.22.jar:io/swagger/v3/parser/urlresolver/matchers/UrlPatternMatcher.class
[error] /user/.cache/coursier/v1/https/repo1.maven.org/maven2/io/swagger/swagger-parser-safe-url-resolver/1.0.70/swagger-parser-safe-url-resolver-1.0.70.jar:io/swagger/v3/parser/urlresolver/matchers/UrlPatternMatcher.class

[error] deduplicate: different file contents found in the following:
[error] /user/.cache/coursier/v1/https/repo1.maven.org/maven2/io/swagger/parser/v3/swagger-parser-safe-url-resolver/2.1.22/swagger-parser-safe-url-resolver-2.1.22.jar:io/swagger/v3/parser/urlresolver/utils/NetUtils.class
[error] /user/.cache/coursier/v1/https/repo1.maven.org/maven2/io/swagger/swagger-parser-safe-url-resolver/1.0.70/swagger-parser-safe-url-resolver-1.0.70.jar:io/swagger/v3/parser/urlresolver/utils/NetUtils.class

[error] Total time: 2 s, completed Oct 11, 2024, 11:27:41 AM

Same problem occurred with 2.1.21, I didn't try with older versions.

I've bypassed problem using MergeStrategy but it doesn't sound like a permanent solution.

Cheers!

@philemone
Copy link
Author

It is worth to mention that it can also lead to unexpected behaviors - when application can use different files in different situation - depends which one will be first on classPath

@ponelat
Copy link
Member

ponelat commented Oct 18, 2024

Thanks @philemone , good catch. Something we can look at fixing!

@frantuma
Copy link
Member

Thanks for reporting it! Fixed in #2137 and #2140, available in 2.1.24

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

No branches or pull requests

3 participants