我目前正在使用Repast进行一个模拟项目。这是一个自定义的eclipse版本,内置了用于实际仿真的库。从定制Eclipse版本添加依赖到Maven
我现在想做出一个Maven项目。然而,我无法弄清楚,如何将Repast-libraries包含到我的pom.xml中,因为mvnrepository中没有条目,我的项目文件夹中也没有这些库。他们都来自就餐插件并驻留我Eclipse安装中,你可以看到如下:
这是我的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>Simulation</groupId>
<artifactId>Simulation</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Simulation</name>
<url>http://maven.apache.org</url>
<build>
<sourceDirectory>src</sourceDirectory>
<outputDirectory>bin</outputDirectory>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>simulation.app.UserMain</mainClass>
<addClasspath>true</addClasspath>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<!-- some other dependencies that are required -->
</dependencies>
</project>
相应的在我的类路径中的条目是这样的:
<classpathentry kind="con" path="REPAST_SIMPHONY_SUPPORT"/>
但是,我怎么把这个放到我的maven项目中? 每当我运行maven构建过程时,生成的JAR都会以“NoClassDefFoundErrors”结束。当我用WinRaR打开JAR文件时,我发现重新装入的库不在那里。
有没有人有一个想法如何解决这个问题?提前致谢!
快速谷歌搜索发现这一点:https://sourceforge.net/p/repast/mailman/message/34207780/ – metame
是的,我知道这个职务。但这是另一种方式。他问,如何将maven依赖关系放入餐厅,而不是将maven餐具放入maven build。 – Johannes