Packaging jar is invalid Aggregator project need pom as packaging

  • In My project I have different modules.
  • Each module have pom.xml in which packaging is a jar. 
  • And each pom refer to common parent.
  • In parent module there is also a pom.xml which includes all the modules.app

    But when i tried to make the packaging in the pom.xml of parent module it shows the error that is "Packaging jar is invalid Aggregator project need pom as packaging".maven

    I want to make the executable jar of the application from maven so,what is the solution for this problem or is there is any other solution.ui

解決方法:this

To make things short: if your parent-aggregator project don't contains source code (and it's a good practice), just add this to your parent pom.xml:code

<packaging>pom</packaging>

If the parent project contains source code, I strongly suggest you to:xml

  • move this code in a new module (let's call it commons)
  • make commons a child module of your parent project
  • add the commons module as a dependency of all other modules requiring it (maybe all of them)
  • add <packaging>pom</packaging> in the parent pom.xml
相關文章
相關標籤/搜索