I've been trying to run this Maven program all day but to no avail. I keep getting this error:
[ERROR] Failed to execute goal org.codehous.mojo:exec-maven-plugin:1.4.0:java (default-cli) on project get-with-jersey: The parameters ‘mainClass’ for goal org.codehaus.mojo:exec-maven-plugin:1.4.0:java are missing or invalid
After running mvn exec:java
.
mvn clean install
works fine and builds, but running the program fails.
I downloaded and placed the plugin for 1.4.0 where I believe Maven lets all it's plugins exist, but I can't figure out why it keeps crashing.
Here is my 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.bridge.rest.jersey</groupId>
<artifactId>get-with-jersey</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Get Request with Jersey</name>
<repositories>
<repository>
<id>maven2-repository.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
</repositories>
<dependencies>
<!--
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
</dependency>
-->
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.9</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.9</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
<version>1.9</version>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
Thanks for your help, looking forward to your answers!
You have not specified the main class to run:
mvn exec:java -Dexec.mainClass=foo.bar.MainClass
http://www.mojohaus.org/exec-maven-plugin/java-mojo.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With