Skip to content

Instantly share code, notes, and snippets.

@zbigniewTomczak
Created December 8, 2012 19:09
Show Gist options
  • Select an option

  • Save zbigniewTomczak/4241451 to your computer and use it in GitHub Desktop.

Select an option

Save zbigniewTomczak/4241451 to your computer and use it in GitHub Desktop.
Maven exec plugin usage
mvn exec:java -Dexec.mainClass="com.example.Main" [-Dexec.args="argument1"] 

OR


  <project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.2.1</version>
        <executions>
          <execution>
            ...
            <goals>
              <goal>java</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <mainClass>com.example.Main</mainClass>
          <arguments>
            <argument>argument1</argument>
            ...
          </arguments>
          <systemProperties>
            <systemProperty>
              <key>myproperty</key>
              <value>myvalue</value>
            </systemProperty>
            ...
          </systemProperties>
        </configuration>
      </plugin>
    </plugins>
  </build>
   ...
  </project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment