java-jar-Dapple.oh.UIElement = obiettivo "vero" / MyAppName-1.0-SNAPSHOT.jar-h non trova il nome della classe
Ho scritto il progetto maven in Eclipse. Funziona correttamente in Eclipse. Voglio eseguire questo progetto in cmd quindi scrivo
java -jar -Dapple.awt.UIElement="true" target/myAppName-1.0-SNAPSHOT.jar -h
Nella riga cmd ma ho questo errore.
Impossibile trovare o caricare la classe principale com.mypacketname.myAppName
Nel mio 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.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>
Ma ho ancora lo stesso errore .Come lo risolvo?
0