• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Classes not getting published to embedded tomcat server of maven (tomcat:run)

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using eclipse indigo IDE, apache tomcat 6.0 server, m2e plugin,jdk 1.6 softwares in my project.

After i make some changes in java code i do clean & maven build and the start the tomcat embedded server using maven i.e. 'tomcat:run' plugin command. But after following all steps i don't see my changes reflecting at all.

Now after i build all classes i see that all the class files are generated inside 'target' folder which i confirmed with the time at which it was generated.So i believe these class files are not getting published to embedded tomcat server of maven for some reasons.

P.S - I don't start/stop or use tomcat server configured in eclipse as i believe embedded tomcat server of maven doesn't use tomcat server in eclipse and it works by itself.Please correct me if i'm wrong here.

Please help me out.
 
Ranch Hand
Posts: 440
Hibernate Eclipse IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

i don't see my changes reflecting at all



This is a very common issue and it is mostly related to configuring your IDE , maven and tomcat properly. The tomcat maven plugin can be configured to run with any server , be it internal ( eclipse configured ) or external server.
First I want to make it clear that maven is a build and project management tool and it has absolutely no link to deploying your application to any web-server. Even if you look at the tomcat-plugin , it just issues a move command to move your war file to your desired location ( webapps of tomcat ). The same goes for tomcat:start and tomcat:run commands of maven ( they just issue the startup.sh and shutdown.sh commands , no magic ) .
So my first question would be , is it any particular reason you are using the tomcat plugin to deploy ? Why not directly use the tomcat server configured inside eclipse and add your project to the context of this server? This way your deployments will be managed from within eclipse as soon as you make changes and save your resources. Tomcat plugin is mainly used when for some complex scenarios e.g like when you have to deploy your web application modules to multiple servers or remote server deployments when your tomcat server exists in a remote destination ( it can be configured as such ).
 
karthik chellappan
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Saif Asif wrote:
First I want to make it clear that maven is a build and project management tool and it has absolutely no link to deploying your application to any web-server. Even if you look at the tomcat-plugin , it just issues a move command to move your war file to your desired location ( webapps of tomcat ). The same goes for tomcat:start and tomcat:run commands of maven ( they just issue the startup.sh and shutdown.sh commands , no magic ) .



If thats the case then when i give 'tomcat:run' command i see only one 'javaw' process running which is the server and under 'services' i see 'Tomcat6' as stopped status. Doesn't that indicate that i'm actually not using tomcat server in my machine. Please clarify.
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think that this is particularly a Tomcat issue. Sounds like more of a Maven problem.

Personally, I use the sysdeo Eclipse plugin to run Tomcat rather than having Maven control Tomcat and have a Tomcat Context set up to point to the maven target.
 
reply
    Bookmark Topic Watch Topic
  • New Topic