• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

How to include the classes of another war module in another war module

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have one war module and I want to use the classes(want to use the methods of that class) of that module in currently working module.
I tried to use maven-war-plugin to explode the war and copy the classes in my target/classes folder. But not able to import the classes. Also tried to create the jar and copy it in my currently web-inf lib folder but still not able tot import the class

Any solution or link to solve this problem.

 
Gourav Bansal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its resolved!!

I explode the war and copy the classes in target/classes folder in validate phases.
 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This will work, but it's the wrong way to do this. What you should do is create another Jar module with the classes that are shared, and add a dependency to the jar module in the 2 war modules. maven will build the jar and then package the jar inside both wars.
 
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
professionally read, modify and write PDF files from Java
https://products.aspose.com/pdf/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!