[MWRAPPER-70] Don't require a pom.xml #251
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or requestpriority:majorMajor loss of functionMajor loss of function
Milestone
Description
Falko Modler opened MWRAPPER-70 and commented
Occasionally, it would come in handy if you could run the wrapper goal without a pom.xml to prepare a folder from scratch.
3.1.1 fails with: "Goal requires a project to execute but there is no POM in this directory"
Affects: 3.1.1
Remote Links:
0 votes, 6 watchers
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestpriority:majorMajor loss of functionMajor loss of function
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