Eclipse中的maven Java项目不会生成jar文件 [英] My maven Java project in Eclipse doesn't generate jar file

查看:388
本文介绍了Eclipse中的maven Java项目不会生成jar文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我使用像mvn compile和mvn install这样的命令行命令,我会在目标目录下看到一个jar文件。

If I use command line command like "mvn compile" and "mvn install", I see a jar file under target directory.

但是如果我建立相同的项目从Eclipse使用m2e插件,我没有看到一个jar文件,但只编译目录目录下的目录,但它们是空的。任何关于这个问题的见解?

But if I build the same project from Eclipse using m2e plugin, I don't see a jar file but only compiled class directories under target directory but they are empty. Any insight on this problem?

推荐答案

m2e不会建立一个jar,除非你要求它。 (一个例外是当您使用某些连接器开发OSGi软件包时,但我假设您不是。)

m2e won't build a jar unless you ask it to. (An exception to that is when you're using it with certain connectors to develop OSGi bundles, but I assume you aren't.)

构建jar:


  • 右键单击包资源管理器视图中的项目文件夹;

  • 选择运行作为

  • 选择Maven安装

这篇关于Eclipse中的maven Java项目不会生成jar文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆