views:

65

answers:

1

I want to use the exec:java plugin to invoke the main class from command line. I can pass arguments from the command line using -Dexec.args="arg0 arg1 arg2", I don't know how to pass system properties. I tried '-Dexec.systemProperties="key=value"` but with no effect.

pom.xml looks like this:

  <plugin>  
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <configuration>
      <mainClass>ibis.structure.Structure</mainClass>
    </configuration>  
  </plugin>
+1  A: 

Deleted earlier content, it was wrong.

There is no way to set the <systemProperties> parameter on the command line.

However, since exec:java is not forked, you can just pass a system property to maven and it will be picked up by exec:java as well.

mvn -Dkey=value exec:java -Dexec.mainClass=com.yourcompany.yourclass \
    -Dexec.args="arg1 arg2 arg3"
seanizer
I thought -Dexec.args is for arguments passed to the main class.
Alexandru
yes, I was wrong. sorry, I updated my answer. `<commandlineArgs>` and `<arguments>` both do pretty much the same thing internally.
seanizer