views:

772

answers:

1

Hi all,

I am trying to deploy and run my webapplication using maven and its tomcat plugin.

I have set it up in project's pom.xml, but when I'm calling it from command line:

mvn tomcat:run

all that I get is:

[root@ovz6022 trunk]# mvn -e tomcat:run
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - com.gotbrains.breeze:breeze:jar:1.0
[INFO]    task-segment: [tomcat:run]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing tomcat:run
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /root/trunk/src/main/resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [tomcat:run {execution: default-cli}]
[INFO] Skipping non-war project
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24 seconds
[INFO] Finished at: Thu Jul 23 14:34:31 MDT 2009
[INFO] Final Memory: 7M/14M
[INFO] ------------------------------------------------------------------------

And that's all. Tomcat hasn't been launched but I don't see any errors here.

Does anybody knows what's happening?

+4  A: 

The clue is in the line:

[INFO] Skipping non-war project

The tomcat:run goal is intended to work with war projects, I'm guessing yours is a jar project.

You need to change the packaging of your project to war, you may also need to provide some additional configuration for the war to actually do anything.

Note: I'd recommend having a separate war project to your jar projects, then adding the jars as dependencies to the war.

Rich Seller