-
Notifications
You must be signed in to change notification settings - Fork 57
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
Can a sub project be a root project as well? Can settings.gradle be set for such a project so it can be run separately? #397
Comments
settings.gradle is a special file that tells gradle where the root level of your project is but you can disable the search for it but as I read the current doc it's marked as deprecated |
Thank you Hillkorn, The problem is that it automatically adds the [-c, ...\project1\settings.gradle] arguments and I don't know where to change that. |
If you would close project1 (and if project2 has its own settings.gradle), then NB should no longer add project1's settings.gradle. This automatic adding of "-c" was added to support other exotic use-cases. However, the question is why does your build fails when run with project1 as a root project. That is, why is it in its settings.gradle if it does not actually support it? That said, it might be reasonable to check if you have explicitly set "-c" and then NB would not specify it explicitly. |
Thank you for reply, kelemen and sorry for not replying so long.
This is not true in my case, when I close project1 and either run or run tests or run intallDist task in all cases NB automatically add this "-c"
The build seems to fail because not only it loads the project1's settings.gradle but also it's main class and this is, I think, because it runs also build.gradle for project1. Also when installDist for project2 is run it copies some config files into the project1 folder and not into project2 folder as it should.
When I try to set this "-c" explicitly via Run ->Set project configuration -> Customize -> Built-In Tasks -> either Run or Test and Adding to Arguments window When I run either installDist or Run in gradle outside NB these problems don't appear, but outside netbeans I have Gradle 2.12 while inside I have 4.5.1 I guess - so maybe here is some difference? UPDATE: updated gradle outside netbeans to 4.10.2 and Netbeans to 8.2 and the behavior is still the same Hope I was clear in my replies and thanks for help. |
I have a following setup (maybe not that clever...)
project1 [root]
project2 [subproject or project 1, but originally it was a separate project and can be run separately]
project3 [subproject of both project 1 and project 2]
My issue is that when I try to run project 2, it runs with settings.gradle from project 1 - the "-c, ....\project1\settings.gradle" argument is added automatically when the run task is performed on project2.
When I try to add "-c, ....\project2\settings.gradle" to the configuration of project2 in Project Properties ->Built-In Tasks -> -> Run -> Arguments the build fails because the -c argumets is added 2 times both for project 2 and project 1.
Can I bypass this auto adding of settings.gradle from project 1 somewhere? Or it is a built-in behavior of the gradle plugin and I have to change my project setup?
Or maybe the problem is just that the build.gradle of the project1 that is also executed? Because the build fails when running project2 with settings.gradle of project1 with an error message that it cannot find main class of project1
Thanks a lot for help.
The text was updated successfully, but these errors were encountered: