You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Amit Misra (Jira)" <ji...@apache.org> on 2022/10/07 16:11:00 UTC

[jira] [Comment Edited] (MWRAPPER-70) Don't require a pom.xml

    [ https://issues.apache.org/jira/browse/MWRAPPER-70?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17614136#comment-17614136 ] 

Amit Misra edited comment on MWRAPPER-70 at 10/7/22 4:10 PM:
-------------------------------------------------------------

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 -

1. 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.

2. 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.


was (Author: JIRAUSER296622):
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 - 

1. 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.

2. 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.

> Don't require a pom.xml
> -----------------------
>
>                 Key: MWRAPPER-70
>                 URL: https://issues.apache.org/jira/browse/MWRAPPER-70
>             Project: Maven Wrapper
>          Issue Type: Improvement
>          Components: Maven Wrapper Plugin
>    Affects Versions: 3.1.1
>            Reporter: Falko Modler
>            Priority: Major
>              Labels: up-for-grabs
>
> 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"



--
This message was sent by Atlassian Jira
(v8.20.10#820010)