Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

eclipse

maven

m2e

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?

like image 872
kee Avatar asked Oct 20 '12 23:10

kee


People also ask

How do I resolve a missing jar in Maven repository?

Look in your . m2 directory (use the paths which you see in the dialog above) and check whether the files are there or whether they are really missing. If they are missing, run "mvn install" (see the "Run as..." menu) to download them.


1 Answers

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"
like image 69
Martin Ellis Avatar answered Sep 30 '22 22:09

Martin Ellis