Problems with gradle project import for gradle projects using buildSrc

已回答

Hello,

on idea ultimate 2021.3 I can't import gradle projects that use buildSrc for sharing configuration. I was able to reproduce the problem on a stripped down example that you find at https://github.com/aanno/Servlet-4.0-Sampler/tree/report/gradle-buildsrc-idea and reported the problem as https://youtrack.jetbrains.com/issue/CWM-4912

I wonder if somebody else steped upon this problem?!?

Kind regards,

Thomas

0

Thanks for the sample. But the project is imported fine for me:

Based on the error

Resolution of the configuration :esdWar:providedCompile was attempted from a context different than the project context. Have a look at the documentation to understand why this is a problem and how it can be resolved. This behaviour has been deprecated and is scheduled to be removed in Gradle 8.0. See https://docs.gradle.org/7.3.3/userguide/viewing_debugging_dependencies.html#sub:resolving-unsafe-configuration-resolution-errors for more details.
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveToStateOrLater(DefaultConfiguration.java:595)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1900(DefaultConfiguration.java:152)

it could be an issue with some of the plugin used, like here.

Also, looking at the final status message:

BUILD SUCCESSFUL in 33s
12 actionable tasks: 12 up-to-date
> Task :prepareKotlinBuildScriptModel UP-TO-DATE

I see that the Gradle Reload action completes successfully. Can you clarify what exact issue do you have with the project?

Btw why did you create the project in Remote Development project? Is it somehow specific to Remote Development or Code With Me? Thanks.

0

Yes, you are right. I've tried the example with another machine in another network and it works. However, the example does not work on the original machine (i.e. the import never ends/stops and the project never became accessible from within idea).

For me, it looks like the problem is related to proxy configuration. The problematic machine has to access internet by an http/https proxy. I configured that proxy with a `gradle.properties` inside the project similar to:

systemProp.http.proxyHost=proxy.example.com
systemProp.http.proxyPort=8080
systemProp.http.nonProxyHosts=*.example.com|localhost

systemProp.https.proxyHost=proxy.example.com
systemProp.https.proxyPort=8080
systemProp.https.nonProxyHosts=*.example.com|localhost

However, this proxy configuration is not used inside the `buildSrc` folder!

0

Thanks for the information. Indeed Gradle should find properties for the buildSrc directory only if they are placed inside buildSrc.

0

请先登录再写评论。