2

我想使用 Maven 插件从 Eclipse 导出一个项目

clean package

该项目有几个依赖项,一个来自我的工作区,还有几个来自例如 Apache。导出发生,.jar 文件已创建。我手动将主文件条目添加到 manifest.mf。当我尝试运行 jar 时,我收到一条错误消息:

no calssDeffoundError: com.apache.org.common.ApplicationCOntxt. ...   
Could not find main class hu.bz.test.Main.

如何使用 Maven 导出具有依赖项的 jar 文件?

4

1 回答 1

1

使用 maven 程序集插件及其 jar-with-dependencies 配置创建 jar -> http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html#jar-with-dependencies

于 2013-08-02T00:08:03.843 回答