所以很长一段时间以来,我一直在网上搜索,不断查看其他人的问题和修复,希望他们会尊重我的问题,但我似乎无法找到任何与 playn 有相同问题的人。
我可以运行“mvn test”,cmd 和 mu 小项目运行完美,但是当我最终使用“mvn clean install”导出项目并尝试运行时,myApp-core-1.0-SNAPSHOT.jar
我得到一个异常:
Exception in thread "main" java.NoClassDefFoundError: playn/core/game
我只是想知道过去是否有人遇到过这个问题并且可以指出我克服它的正确方向,因为这个应用程序是我的 A-level 课程并且很快就会提交我很担心我可能达不到交日期的最后期限,我真的希望这不会发生 D:
这是我的myApp-core pom.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-
v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.ALevelWork</groupId>
<artifactId>zombiepanic</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>zombiepanic-core</artifactId>
<packaging>jar</packaging>
<name>ZombiePanic Core</name>
<dependencies>
<dependency>
<groupId>com.googlecode.playn</groupId>
<artifactId>playn-jbox2d</artifactId>
<version>${playn.version}</version>
</dependency>
<dependency>
<groupId>com.googlecode.playn</groupId>
<artifactId>playn-core</artifactId>
<version>${playn.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<!-- Build an executable JAR -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass> ZombiePanic.core.ZombiePanic</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
</plugins>
<resources>
<!-- include the source files in our main jar for use by GWT -->
<resource>
<directory>${project.build.sourceDirectory}</directory>
</resource>
<!-- and continue to include our standard resources -->
<resource>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>
</build>
</project>
提前致谢,
雅各布