File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Classes not getting published to embedded tomcat server of maven (tomcat:run) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Classes not getting published to embedded tomcat server of maven (tomcat:run)" Watch "Classes not getting published to embedded tomcat server of maven (tomcat:run)" New topic
Author

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

karthik chellappan
Ranch Hand

Joined: Jul 01, 2007
Posts: 31
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.


karthik
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

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 ).


Muhammad Saif Asif Mirza
OCJA(5/6) OCJP(6) OCJWCD(6)
karthik chellappan
Ranch Hand

Joined: Jul 01, 2007
Posts: 31
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.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Classes not getting published to embedded tomcat server of maven (tomcat:run)