I\'m a Maven newbie, so I apologize if this is something trivial. Basically, I am developing a webapp, and I am using Maven to manage the project. I have
I dont think you can create a jar file from some packages because pom file belongs to one java/web project and not for individual packages in java project. You can create a new java project named e.g xyz-common which should have the code which will be shared with other war files. Then you can simple do mvn install and your xyz-common jar will be created with some version. Then update the pom file of the war file which needs your common jar with its dependency.
I assume your java packages are inside the war file? If so, better create a new java project and don't tightly couple your java code with war file. In your war file, just mention the dependency of your jar file.