Home > Build-Management, Software Engineering > Maven execute .jar

Maven execute .jar

pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

  <groupId>com.test</groupId>
  <version>1.0.0</version>
  <artifactId>MavenExec</artifactId>
  <packaging>pom</packaging>

  	<build>
            <plugins>
		<plugin>
			<groupId>org.codehaus.mojo</groupId>
			<artifactId>exec-maven-plugin</artifactId>
			<version>1.1.1</version>
			<executions>
				<execution>
					<phase>test</phase>
					<goals>
						<goal>exec</goal>
					</goals>
				</execution>
			</executions>
			<configuration>
				<executable>java</executable>
				<arguments>
					<argument>-jar</argument>
					<argument>test.jar</argument>
				</arguments>
			</configuration>
		</plugin>
	     </plugins>
	</build>
</project>
mvn exec:exec
Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s