Configure Maven so that it uses jars for compilation but excludes them while bundling into war file -


i got requirement customize our projects using maven. have 3 projects based on spring & hibernate. hence, there repeated jars in each war file while building, increases size unnecessarily while deployment.

so have decided keep jar dependencies 1 project called "commonjars" , other existing projects use them. deployment, want generate tar/zip file of "commonjars" (while deploying should extracted in folder, lib folder of tomcat common projects deployed in webapps folder) , other war file without jars. can reduce size of war files of 3 projects.

can suggest me on how can achieve this? new maven, unable find proper solution this.

i not agree approach solve maven issue, need include 'scope' in maven dependency.

example:

<dependency>     <groupid>org.hibernate</groupid>     <artifactid>hibernate-core</artifactid>     <version>5.0.1.final</version>     <scope>provided</scope> </dependency> 

the maven scope 'provided' allow compile projects maven not include them in war.

good luck.


Comments