Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7207

Direct Maven Command Line To Run Without Projects

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.8.1
    • None
    • Command Line

    Description

      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 run 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 that was completely unrelated to what I wanted to do, but mvn tried to validate it anyway (and that might not always work). 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 to extend 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

      Attachments

        Activity

          People

            Unassigned Unassigned
            Krajewski Robert Krajewski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: