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

Unable to build when maven project is in a sub-directory #110

Open
ctron opened this issue Feb 13, 2018 · 4 comments
Open

Unable to build when maven project is in a sub-directory #110

ctron opened this issue Feb 13, 2018 · 4 comments

Comments

@ctron
Copy link
Contributor

ctron commented Feb 13, 2018

It seems that the java build has an issue when the source code of the maven project is inside a sub-directory of the repository.

There is a check in the assemble script which checks for the existence of the pom.xml, but this uses S2I_SOURCE_DIR, which it seems cannot be overridden by the build.

My proposal would be to add some additional kind of environment variable (e.g. SOURCE_ROOT_DIR) which defaults to . and can be overridden.

@rhuss
Copy link
Contributor

rhuss commented Feb 19, 2018

Sounds fair to me. Fancy doing a PR ?

The question is, whether we should also allow for a path to a pom.xml (by setting a POM env var and adding a -f $POM to the maven command line in case), which would keep the working directory still at S2I_SOURCE_DIR.

For the directory env var name I'd suggest something like POM_DIR (for cd'ing into the dir and running a plain maven) and POM_FILE for pointing to a pom.xml (and keeping the cd at S2I_SOURCE_DIR)

@ctron
Copy link
Contributor Author

ctron commented Feb 22, 2018

I will look into this.

@cmoulliard
Copy link

Do we plan to support this option which is needed when by example we have a maven project having several maven modules without parent pom.xml ?

@ctron
Copy link
Contributor Author

ctron commented Sep 12, 2019

I think this should be possible by using -f subdirectory in the MAVEN_ARGS variable. And then maybe tweaking the ARTIFACT_DIR in addition.

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

3 participants