File tree Expand file tree Collapse file tree 4 files changed +32
-19
lines changed
plugins/package-managers/gradle-plugin/src/main/kotlin Expand file tree Collapse file tree 4 files changed +32
-19
lines changed Original file line number Diff line number Diff line change 11distributionBase =GRADLE_USER_HOME
22distributionPath =wrapper/dists
3- distributionSha256Sum =e111cb9948407e26351227dabce49822fb88c37ee72f1d1582a69c68af2e702f
4- distributionUrl =https\://services.gradle.org/distributions/gradle-8.1.1 -bin.zip
3+ distributionSha256Sum =38f66cd6eef217b4c35855bb11ea4e9fbc53594ccccb5fb82dfd317ef8c2c5a3
4+ distributionUrl =https\://services.gradle.org/distributions/gradle-8.2 -bin.zip
55networkTimeout =10000
6+ validateDistributionUrl =true
67zipStoreBase =GRADLE_USER_HOME
78zipStorePath =wrapper/dists
Original file line number Diff line number Diff line change @@ -130,10 +130,13 @@ location of your Java installation."
130130 fi
131131else
132132 JAVACMD=java
133- which java > /dev/null 2>&1 || die " ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
133+ if ! command -v java > /dev/null 2>&1
134+ then
135+ die " ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
134136
135137Please set the JAVA_HOME variable in your environment to match the
136138location of your Java installation."
139+ fi
137140fi
138141
139142# Increase the maximum file descriptors if we can.
Original file line number Diff line number Diff line change @@ -162,23 +162,32 @@ internal class OrtModelBuilder : ToolingModelBuilder {
162162
163163 when (val id = selectedComponent.id) {
164164 is ModuleComponentIdentifier -> {
165- val repositoryName = (selectedComponent as ? ResolvedComponentResultInternal )?.repositoryName
166- val pomFile = repositories[repositoryName]?.let { repositoryUrl ->
167- // Note: Only Maven-style layout is supported for now.
168- buildString {
169- append(repositoryUrl.removeSuffix(" /" ))
170- append(' /' )
171- append(id.group.replace(' .' , ' /' ))
172- append(' /' )
173- append(id.module)
174- append(' /' )
175- append(id.version)
176- append(' /' )
177- append(id.module)
178- append(' -' )
179- append(id.version)
180- append(" .pom" )
165+ val pomFile = if (selectedComponent is ResolvedComponentResultInternal ) {
166+ val repositoryId = runCatching { selectedComponent.repositoryId }
167+ .recoverCatching {
168+ @Suppress(" DEPRECATION" )
169+ selectedComponent.repositoryName
170+ }.getOrNull()
171+
172+ repositories[repositoryId]?.let { repositoryUrl ->
173+ // Note: Only Maven-style layout is supported for now.
174+ buildString {
175+ append(repositoryUrl.removeSuffix(" /" ))
176+ append(' /' )
177+ append(id.group.replace(' .' , ' /' ))
178+ append(' /' )
179+ append(id.module)
180+ append(' /' )
181+ append(id.version)
182+ append(' /' )
183+ append(id.module)
184+ append(' -' )
185+ append(id.version)
186+ append(" .pom" )
187+ }
181188 }
189+ } else {
190+ null
182191 }
183192
184193 val modelBuildingResult = poms.getValue(id.toString())
You can’t perform that action at this time.
0 commit comments