My maven Java project in Eclipse doesn't generate jar file

六眼飞鱼酱① 提交于 2020-01-12 14:22:08

问题


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

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?


回答1:


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.)

To build a jar:

  • Right-click on the project folder in the 'Package Explorer' view;
  • Select "Run As"
  • Select "Maven install"


来源:https://stackoverflow.com/questions/12993504/my-maven-java-project-in-eclipse-doesnt-generate-jar-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!