Running a class file through "mvn exec: exec"

I am new to maven and am having problems running class file through maven

It works fine with mvn exec: java -Dexec.mainclass = "com.test.Test"

But not using mvn exec: exec -Dexec.executable = java -Dexec.mainclass = "com.test.Test"

It is requesting java parameters

F:\data\work\Test>mvn exec:exec -Dexec.executable=java -Dexec.mainClass="com.test.Test"
Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)
where options include:
    -d32          use a 32-bit data model if available
    -d64          use a 64-bit data model if available
    -server       to select the "server" VM
    -hotspot      is a synonym for the "server" VM  [deprecated]
                  The default VM is server.

    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
                  A ; separated list of directories, JAR archives,
                  and ZIP archives to search for class files.

I already provide the class file, and then why can't I select it? I tried to provide them even through pom.

I use exec: exec as I don't want to pass VM arguments from MAVEN_OPTS

here is my pom

<profiles>  
 <profile>  
  <id>fib</id>  
  <build>  
   <plugins>  
    <plugin>  
     <groupId>org.codehaus.mojo</groupId>  
     <artifactId>exec-maven-plugin</artifactId>  
     <version>1.3.2</version>  
     <executions>  
      <execution>  
       <phase>test</phase>  
       <goals>  
        <goal>exec</goal>  
       </goals>  
       <configuration>  
        <mainClass>com.test.Test</mainClass>  
        <executable>java</executable> 
       </configuration>  
      </execution>  
     </executions>  
    </plugin>  
   </plugins>  
  </build>  
 </profile>  
</profiles>

What am I missing?

, 2 -
1) , java, mainClass?
2) VM exec-maven-plugin?

maven 'exec: exec'

+4
1
mvn exec:exec -Dexec.executable=java -Dexec.args="-classpath target/classes -XX:+PrintGCDetails com.test.Test"

, , classpath, classpath

: http://chat.stackoverflow.com/rooms/67085/discussion-between-biker-and-jigar-joshi

+4

All Articles