File tree Expand file tree Collapse file tree
plugins/package-managers/gradle-plugin/src/main/kotlin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import org.gradle.api.artifacts.Configuration
2525import org.gradle.api.artifacts.dsl.RepositoryHandler
2626import org.gradle.api.artifacts.repositories.ArtifactRepository
2727import org.gradle.api.artifacts.repositories.AuthenticationSupported
28+ import org.gradle.api.artifacts.repositories.PasswordCredentials
2829import org.gradle.api.artifacts.repositories.UrlArtifactRepository
2930import org.gradle.api.attributes.AttributeContainer
3031import org.gradle.internal.deprecation.DeprecatableConfiguration
@@ -71,7 +72,10 @@ internal fun RepositoryHandler.associateNamesWithUrlsTo(repositories: MutableMap
7172 * Convert this [UrlArtifactRepository] to an [OrtRepository] by extracting the relevant properties.
7273 */
7374internal fun UrlArtifactRepository.toOrtRepository (): OrtRepository {
74- val credentials = (this as ? AuthenticationSupported )?.credentials
75+ val credentials = (this as ? AuthenticationSupported )?.let { authSupported ->
76+ runCatching { authSupported.getCredentials(PasswordCredentials ::class .java) }.getOrNull()
77+ }
78+
7579 return OrtRepositoryImpl (
7680 url = url.toString(),
7781 username = credentials?.username,
You can’t perform that action at this time.
0 commit comments