-
Notifications
You must be signed in to change notification settings - Fork 13
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
Changes to root files cause rebuild of entire maven graph #423
Comments
Hi @jbadeau |
We've experienced the same. It works perfectly for us if we disable
Is there a reason the projects are added even though if they don't have a project.json? It also breaks by the way in the nx graph. |
@dpnolte, I add the project root to the graph, so if we change Gradle config files, we need to rebuild all Gradle projects. |
I’ll try the nxignore later today
…On Wed, 6 Sep 2023 at 15:50, khalilou88 ***@***.***> wrote:
@dpnolte <https://github.com/dpnolte>, I add the project root to the
graph, so if we change Gradle config files, we need to rebuild all Gradle
projects.
—
Reply to this email directly, view it on GitHub
<#423 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABFJO3EYU6KQC352FSYLXDXZB5UBANCNFSM6AAAAAA4J6K5NM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Ah right. I understand your point. The downside is though that now a unrelated change (like a change in the README file) can cause all the gradle projects to be affected. I also noticed that it breaks the prompts when running stuff like Jsut thinking out loud here, but wouldn't it be an option to add the related files as (named) inputs to gradle projects when generating the projects and without having the workspace root as a project? Something like:
What do you think? |
I wound def prefer named inputs. Forcing entire graph to rebuild is very expensive. |
@jbadeau for maven projects it's different, we need to add root project to the graph with build executor (mvn install -N). Otherwise it's will not work. See this old issue : #20 For Gradle we don't need to build the root project |
@dpnolte I don't want to add same config to all projects. If the |
@dpnolte just checked Inputs could be set in EDIT: actually it's not a good solution because it will affect other project like angular or react.. |
What about maven? The .nxignore breaks the build as it’s looking for the root Pom. |
@jbadeau I will investigate changing the
But before I need to create a reproduction with smoke tests to be sure that I will correct this issue. |
Alrighty. |
For information, before looking at this issue, we need to update code to use NxPluginV2 |
What’s that? New api from nx? |
@jbadeau It's the new way to add projects to the |
Hi @jbadeau I am working to make The |
That’s great news. A few questions
I currently have a pom.xml and a project.json at the root and I ignore almost everything at toot using .nxignore. If I could move the parent pom to any folder that would be ideal. im pretty flexible |
|
I upgraded to 16.7.4 of Nx and I see that whenever I change any Java code in a app module, it is building all apps. Previously it used to work fine. Not sure where I did the mistake. |
nx affected is building all Spring boot projects no matter which app file is changed. |
nx:affected graph is showing only one project, but when I am running in the Azure pipeline it is building all spring boot projects. |
@nosaku it was working before in azure ? I think you miss something to make azure work with Nx? |
Yes it was working fine previously then I did "nx repair" as I saw some warnings. Not sure if it got broken after this. I am trying with a separate branch now. |
I create package-lock manually. Does it make any difference? npm install --no-save I did this long ago when "nx" was considering package.json always changes when doing "npm install" as the timestamp was getting updated with a "blank line" and triggering all builds. But this I did very long ago. |
just changed the .mvn/jvm.config and pushed the changes and it built all the spring boot apps. To build affected apps I am using below which was working fine till recently. nx affected --target=build --parallel=3 --base=HEAD~1 --configuration=train |
Added .nxignore and copied all .gitignore stuff there including package-lock.json. Still nx affected builds all Spring boot apps... it works fine if I change NestJS or Angular apps and only those are built. But along with them all spring boot apps are built too. And if I change only package.json or any other spring boot app file, it builds all spring boot apps. |
Are you sure you have no root changes between in your base and head |
Yes no changes.. I just tried by changing one source file in one spring boot app. |
When I run the below in Azure pipeline, I always get all Spring boot apps... but when I run locally I get only the changed app. nx show projects --affected --base=HEAD~1 |
Does it make any difference with local being Windows and pipeline being self hosted Ubuntu? |
I tried in a Linux machine and nx affected shows all spring boot apps... the same in Windows show only the one which is affected. |
I don't think it's a good idea to put |
Hello there,
I noticed an issue in the Nx affected graph. If I have a pom.xml at the repo root and I modify any other file (e.g. README.MD) in the root I get an affected graph of all the maven projects. In this case I have no project.json at the root.
I am using:
nx: 16.7.2
@jnxplus/nx-boot-maven: 7.3.0
Might have crept in when making the change to include parent poms as dependencies. I would be ok with the root pom being only an aggregator pom and not being part of the graph.
My root pom looks like:
Thoughts?
The text was updated successfully, but these errors were encountered: