Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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

 
Ranch Hand
Posts: 45
  • 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: 45
  • 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.
 
    Bookmark Topic Watch Topic
  • New Topic