You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please correct me if I am wrong the requirement of a pom.xml being present in the current working directory comes from the underlying mvn command.
Having said that, I think this could be done in two steps -
Find the pom.xml file to be used first. Search for parent folders for mvnw executable something similar to what gng and gw does - https://github.com/gdubw/gng) and then go ahead and execute the command with -f option, assuming the pom.xml is not named differently. In the latter case, the user anyways has to tell mvnw the file to use so we should be good.
Use a temporary pom.xml file. In case the last step is not able to find a valid pom.xml file, create a temporary pom.xml file in the current directory, execute the command and then clean up the temporary file.
Open to other suggestions if this approach seems too naive or overly complicated.
Thorbjørn Ravn Andersen from what I understood from the original issue, mvnw command fails if you run inside a directory that does not have a pom.xml file with the following error message - {}Goal requires a project to execute but there is no POM in this directory{}.
Having a temporary pom.xml (generated on the fly) could help in running the mvnw command
Activity
jira-importer commentedon Oct 4, 2022
Slawomir Jaranowski commented
Should be ok.
jira-importer commentedon Oct 7, 2022
Amit Misra commented
Please correct me if I am wrong the requirement of a pom.xml being present in the current working directory comes from the underlying
mvncommand.Having said that, I think this could be done in two steps -
Find the
pom.xmlfile to be used first. Search for parent folders formvnwexecutable something similar to whatgngandgwdoes - https://github.com/gdubw/gng) and then go ahead and execute the command with-foption, assuming thepom.xmlis not named differently. In the latter case, the user anyways has to tellmvnwthe file to use so we should be good.Use a temporary
pom.xmlfile. In case the last step is not able to find a validpom.xmlfile, create a temporarypom.xmlfile in the current directory, execute the command and then clean up the temporary file.Open to other suggestions if this approach seems too naive or overly complicated.
jira-importer commentedon Oct 17, 2022
Thorbjørn Ravn Andersen commented
What is the use case? What would this temporary pom enable doing?
jira-importer commentedon Dec 17, 2022
Amit Misra commented
Thorbjørn Ravn Andersen from what I understood from the original issue, mvnw command fails if you run inside a directory that does not have a pom.xml file with the following error message - {}Goal requires a project to execute but there is no POM in this directory{}.
Having a temporary pom.xml (generated on the fly) could help in running the mvnw command