java-jar -Pommelé.awt.UIElement=" true " target / MyAppName-1.0-SNAPSHOT.jar-h ne trouve pas le nom de la classe


J'ai écrit le projet maven dans Eclipse. Il fonctionne correctement dans Eclipse. Je veux exécuter ce projet en cmd donc j'écris

java -jar -Dapple.awt.UIElement="true" target/myAppName-1.0-SNAPSHOT.jar -h 

Dans la ligne cmd mais j'ai cette erreur.

Impossible de trouver ou de charger la classe principale com.mypacketname.Monappname

Dans mon pompon.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.hasanozgan.challenge</groupId>
<artifactId>persona</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>persona</name>
<url>http://maven.apache.org</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <jdk.version>1.6</jdk.version>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.7.2</version>
            <configuration>
                <skipTests>false</skipTests>
            </configuration>
        </plugin>




        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
                        <classpathLayoutType>repository</classpathLayoutType>
                        <classpathPrefix>${settings.localRepository}</classpathPrefix>

                        <mainClass>com.hasanozgan.challenge.App</mainClass>
                    </manifest>
                </archive>
            </configuration>
        </plugin>
        <!-- <plugin> <artifactId>maven-dependency-plugin</artifactId> <executions> 
            <execution> <id>copy</id> <phase>install</phase> <goals> <goal>copy-dependencies</goal> 
            </goals> <configuration> <outputDirectory> ${project.build.directory}/lib 
            </outputDirectory> </configuration> </execution> </executions> </plugin> -->
    </plugins>
</build>

<dependencies>
    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>1.9.5</version>
    </dependency>

    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.14</version>
        <scope>runtime</scope>
    </dependency>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.10</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>mongo-java-driver</artifactId>
        <version>2.7.2</version>
    </dependency>
    <dependency>
        <groupId>com.google.code.morphia</groupId>
        <artifactId>morphia</artifactId>
        <version>0.99.1-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>commons-cli</groupId>
        <artifactId>commons-cli</artifactId>
        <version>1.2</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>3.1.2.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>3.1.2.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>3.1.2.RELEASE</version>
    </dependency>

</dependencies>

<repositories>
    <repository>
        <id>morphia</id>
        <url>http://morphia.googlecode.com/svn/mavenrepo/</url>
    </repository>
</repositories>

Mais j'ai toujours la même erreur .Comment je le résous?

Author: HKY, 2015-11-29