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

[discussion] Support of maven project, modules, parent #179

Open
cmoulliard opened this issue Oct 30, 2019 · 10 comments
Open

[discussion] Support of maven project, modules, parent #179

cmoulliard opened this issue Oct 30, 2019 · 10 comments
Labels
discussion enhancement New feature or request

Comments

@cmoulliard
Copy link
Contributor

cmoulliard commented Oct 30, 2019

Discussion

This ticket list the different maven project combinations and the problems that currently we must resolve

1. Multiple independent components under a single git repo without a parent pom

demo
  .git
  .mvn
  fruit-backend-sb
  fruit-client-sb
  mvnw
  • Binary push: OK
  • Source push: OK
  • Build mode: KO because of the s2i following problem as a pom.xml is needed within the /path of the project

2. Multi-module maven project under a single parent

demo
  .git
  .mvn
  fruit-backend-sb
  fruit-client-sb
  mvnw
  pom.xml
  • Binary push: OK
  • Source push: KO as parent pom doesn't get pushed along with the module code and therefore maven
    cannot build (unless parent is already published in a publicly available maven repo)
  • Build mode: OK

3. Multi-module maven project under a single parent

Remark: The children don't reference the parent (BAD organization in terms of maven project)

demo
  .git
  .mvn
  fruit-backend-sb  // The children don't reference the parent
  fruit-client-sb       // The children don't reference the parent
  mvnw
  pom.xml
  • Binary push: OK
  • Source push: OK as parent pom doesn't exist for all intent and purposes of building the children
    modules. However, this can only work if nothing in the parent is needed by the children (though
    the same would happen with a regular maven build)
  • Build mode: OK
@cmoulliard cmoulliard added discussion enhancement New feature or request labels Oct 30, 2019
@cmoulliard
Copy link
Contributor Author

cmoulliard commented Oct 30, 2019

I propose that we only support project structure 1. and 2. Make sense @metacosm ?

@cmoulliard
Copy link
Contributor Author

For project type2, this is I think the responsibility of the CLI tool to push in this case the project with : pom.xml, moduleA, moduleB,....,moduleX. WDYT @metacosm ?

@metacosm
Copy link
Collaborator

I agree that we should only support types 1 and 2 since these are the logical organizations that people are likely to use. We should also support the most common use case which is: single module per git repo.

For project type2, this is I think the responsibility of the CLI tool to push in this case the project with : pom.xml, moduleA, moduleB,....,moduleX. WDYT @metacosm ?

I'm not sure as this means that some of the intelligence needs to move to the client and I think that the operator should actually handle that case. That said, I'm not sure what can be done without the client informing the operator about it. I really don't like this because that means having to handle special cases in the client. Then if consider that's only one special case among possibly many for different build systems and you start to see why I don't really like opening this Pandora's box.

@cmoulliard
Copy link
Contributor Author

That said, I'm not sure what can be done without the client informing the operator about it.

Even if the client informs the operator, all the code should be pushed or at least the module plus the parent pom.xml

@metacosm
Copy link
Collaborator

metacosm commented Oct 30, 2019

That said, I'm not sure what can be done without the client informing the operator about it.

Even if the client informs the operator, all the code should be pushed or at least the module plus the parent pom.xml

And that's exactly what I would like to avoid because that requires the client to know about maven (and gradle, and npm and…). Problem is: I'm not sure how to make it work otherwise… :(

@cmoulliard
Copy link
Contributor Author

Something else to be considered is :

  • Do we want to continue to use the s2i image which suffers from the limitation or restriction that a pom.xml is needed at the root of the project from where mvn is executed OR
  • That we use too for the Tekton build our mvn-jdk image where we can define the contextDir and moduleName OR
  • That we use JIB to build the image from the code source

@cmoulliard
Copy link
Contributor Author

And that's exactly what I would like to avoid because that requires the client to know about maven (and gradle, and npm and…). Problem is: I'm not sure how to make it work otherwise… :(

The only solution that I see is to ask a question to the developer with the CLI in order to know if this is :

  • A maven project with only one module -> 1 component
  • A maven project with several modules + parent -> x components
  • A maven project with several modules without pa rent -> not supported

@metacosm
Copy link
Collaborator

And that's exactly what I would like to avoid because that requires the client to know about maven (and gradle, and npm and…). Problem is: I'm not sure how to make it work otherwise… :(

The only solution that I see is to ask a question to the developer with the CLI in order to know if this is :

* A maven project with only one module -> 1 component

* A maven project with several modules + parent -> x components

* A maven project with several modules without pa rent -> not supported

This still requires the client to know about maven…

@cmoulliard
Copy link
Contributor Author

This still requires the client to know about maven…

Why. According to the response, you copy/push the content of the current folder for the scenario - 1 component and for the second scenario (x comonents) all the files and sub-folders

@metacosm
Copy link
Collaborator

This still requires the client to know about maven…

Why. According to the response, you copy/push the content of the current folder for the scenario - 1 component and for the second scenario (x comonents) all the files and sub-folders

How does the tool know that the directories are actually maven modules that should be considered as components without knowing about maven?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants