Havnar
Havnar

Reputation: 2628

Maven execute external jar file

In my project I have a .jar file called validator.jar in main/resources.

I want to validate the package that I made with by running this .jar file, both with maven.

What I tried so far is:

            <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.2.1</version>
            <executions>
                <execution>
                    <id>default-cli</id>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                    <configuration>
                        <executable>src/main/resources/validator.jar</executable>

                        <arguments>
                            <argument>-f target/PROJECT-${project.version}-el6.myext</argument>
                        </arguments>
                    </configuration>
                </execution>
            </executions>
        </plugin>

This runs the jar, but doesn't seem to take in the arguments.

on the commandline it should look like this (this works):

java -jar -f target/PROJECT-1.0-el6.myext

Upvotes: 0

Views: 1444

Answers (1)

Harald Wellmann
Harald Wellmann

Reputation: 12855

Try this:

<arguments>
    <argument>-f</argument>
    <argument>target/PROJECT-${project.version}-el6.myext</argument>
</arguments>

Upvotes: 2

Related Questions