Hi Wayne,
thanks for your quick reply. I found the answer to my problem, which is
using the 'tomcat:run-war' instead of the 'tomcat:run' goal. But let me
describe my original problem which might help others with similar problems:
1. In our web app we are uploading files and store them in a directory under
the Tomcat docbase so that Tomcat can deliver those files (at least in the
development environment). We use the method
session.getServletContext().getRealPath() for that.
2. When i used the 'tomcat:run' goal those uploaded files were stored under
/src/main/webapp and you definitely don't want to have them there. So I
found the <webSourceDirectory> parameter and changed it to
${project.build.directory}/${project.build.finalName} which is the directory
build by the maven-war-plugin. The Tomcat docBase was changed but now all
the class and resources files were there twice: in the WEB-INF/classes
directory of ${project.build.directory}/${project.build.finalName} and in
target/classes because that directory is added to the Tomcat classpath. So I
wanted to avoid that and found the <classesDir> which doesn't work.
So I found the solution to use 'tomcat:run-war' with a <warDirectory> set to
${project.build.directory}/${project.build.finalName} which does exactly
what I want.
Chris
Wayne Fay wrote:
>
>> trying to avoid that the ${project.build.outputDirectory} (which is
>> target/classes) is added to the classloader classpath. I found the
>> classesDir parameter in the documentation. No matter what value I give to
>
> Why do you want to do this? If this is a common need, it may be smart
> to have a new feature added to the plugin to support this
> functionality that you require.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
>
--
View this message in context:
http://old.nabble.com/Tomcat-Maven-Plugin-classesDir-tp29617622p29621720.html
Sent from the mojo - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email