5

I am running someone else's pom.xml which has:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.3.2</version>
    <executions>
        <execution>
            <goals>
                <goal>java</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <mainClass>${main.class.remote-query}</mainClass>
    </configuration>
</plugin>

When I run mvn with -X the actual command that is executed is not displayed. Changing java to exec will probably provide it but I am curious if there is a way to see the full command line when using java.

observer
  • 2,925
  • 1
  • 19
  • 38
user3722575
  • 71
  • 1
  • 2
  • 8

1 Answers1

0

According to ExecJavaMojo.html is should say something like: 'Invoking ' + the class to call + main-method + its arguments. However, it is executed within the same JVM and not from commandline.

kenorb
  • 155,785
  • 88
  • 678
  • 743
Robert Scholte
  • 11,889
  • 2
  • 35
  • 44
  • 1
    Thanks. In the maven DEBUG output I see "[DEBUG] Invoking : " but it does not show the full command line which can be copied and pasted into a CMD screen to run. I am looking for something similar to the logged message when source code is compiled. – user3722575 Feb 13 '15 at 20:18
  • Because it is not executed like that. I guess you're looking for something like `java [-options] com.foo.bar.Main [args...]`. Best option you have is described as http://mojo.codehaus.org/exec-maven-plugin/examples/example-exec-for-java-programs.html – Robert Scholte Feb 13 '15 at 20:51
  • That documentation is currently not available. What kind of option are you implying? – Sridhar Sarnobat Jun 11 '15 at 22:00
  • Plugin documentation has been moved to http://www.mojohaus.org/exec-maven-plugin/ – Robert Scholte Jun 12 '15 at 17:25
  • It wasnt printing arguments in my case, so I looked into ExecJavaMojo.html. It turns out, that it will only print the arguments if getLog().isDebugEnabled() return true. – Tigerware Aug 30 '18 at 14:39