You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Krajewski (Jira)" <ji...@apache.org> on 2021/08/07 17:25:00 UTC

[jira] [Created] (MNG-7207) Direct Maven Command Line To Run Without Projects

Robert Krajewski created MNG-7207:
-------------------------------------

             Summary: Direct Maven Command Line To Run Without Projects
                 Key: MNG-7207
                 URL: https://issues.apache.org/jira/browse/MNG-7207
             Project: Maven
          Issue Type: Improvement
          Components: Command Line
    Affects Versions: 3.8.1
            Reporter: Robert Krajewski


It would be nice to direct Maven to skip finding a default project to run so that it did not attempt to use a project for goals that were intended to be without a project.

This is useful for both the “Maven as command line tool” use case and the embedded use of Maven goals for getting things done without reference to any project that might be in the current directory, because unexpected things can happen if a project is present in the current directory.

For example, I wrote a command that uses Maven to allow off-line usage of our product’s artifacts, and ran into this issue when I tried running the command in a directory that had a pom.xml in completely unrelated to what I wanted to do. The workaround was to create an empty temporary directory and then run mvn with that as the current directory.

I am not sure how this should be designed. One possibility is a flag or boolean option as an entirely new option. Another would be override f/file somehow in a way that doesn’t break expectations.

This option does not appear in https://maven.apache.org/ref/3.8.1/maven-embedder/cli.html



--
This message was sent by Atlassian Jira
(v8.3.4#803005)