Skip to content
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

[IDEA] Make project.json mandatory #479

Closed
khalilou88 opened this issue Oct 1, 2023 · 12 comments
Closed

[IDEA] Make project.json mandatory #479

khalilou88 opened this issue Oct 1, 2023 · 12 comments

Comments

@khalilou88
Copy link
Owner

khalilou88 commented Oct 1, 2023

The project.json file is not mandatory, the plugins add projects without project.json to the graph. But for more configuration, we need to create this file.

I am thinking about making this file mandatory, and raising an error if the file is messing.
For maven, we can check if project name and artifactId are the same.

We can create a project.json for the root project in wrapper folder so users can update namedInputs. And like this the maven/gradle root project is different from nx root project.

Create a generator to generate missing project.json files

@jbadeau
Copy link

jbadeau commented Oct 3, 2023

Why is it required to have a root Pom.xml? Is this a limitation of the nxgraph api?

@khalilou88
Copy link
Owner Author

For me, maven multi modules works like this :https://spring.io/guides/gs/multi-module/

How about make root pom.xm minimal and move everything to another pom.xm?

With this solution there is no chance to modify it. I can show you this in a GitHub repo.

Also I am making the wrapper optional and you will have less files in the root folder

@jbadeau
Copy link

jbadeau commented Oct 3, 2023

Making the wrapper optional is great.

In general, maven doesn’t require sub modules to be physically below the root Pom.

Im ok with an aggregator pom at the root. I assume it will not be added to the nx graoh. This pom also would never be published.

@jbadeau
Copy link

jbadeau commented Oct 3, 2023

A few things would need to be added to this root Pom like repositories and the preprocessing plugins like the flatten plugin

@jbadeau
Copy link

jbadeau commented Oct 3, 2023

But this is only needed by the provider and is not needed by the consumer

@jbadeau
Copy link

jbadeau commented Oct 3, 2023

Any ETA on this. Should I review something?

@khalilou88
Copy link
Owner Author

If you speak about optional wrapper, this week. If you speak about mandatory project.json it's in draft mode because maybe it will just make the plugin complex

@jbadeau
Copy link

jbadeau commented Oct 3, 2023

Wrapper is not urgent. Was just curious

@khalilou88
Copy link
Owner Author

@jbadeau your idea about moving the pom.xml is not bad. It's good to isolate maven projects.
I think the best idea is to have a variable : mavenRootDirectory and generate there all maven projects and wrapper if it's not optional. The problem here is you will not merge maven projects with other projects

@khalilou88 khalilou88 changed the title Make project.json mandatory [IDEA] Make project.json mandatory Oct 3, 2023
@jbadeau
Copy link

jbadeau commented Oct 13, 2023

How’s it going? Do u need any help. We have some large maven repos using your plugins maybe it helps with the design if u see how we work?

@khalilou88
Copy link
Owner Author

@jbadeau for project.json, maybe i will make it mandatory but not as described in this issue. project.json and pom.xml should be in the same folder.

generating maven projects in a subfolder, it's not hard, just i need to choose where to save mavenRootDirectory, first option inside nx.json or if i cant, i will try to put it in a env.file in root folder

will close this issue and create a new one. Please comment on the new one

@khalilou88
Copy link
Owner Author

@jbadeau #519

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants