It is very hard to know the exact problem with so few details, however my guess would be that you have the wrong directory structure. Your code must be in the src/main/java/packagepath
directory otherwise maven will not be able to find it and will create an empty jar/war.
As an additional note, the compile
phase is included when you invoke the install
phase so you do not need to explicitly call it.