我目前正在使用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