You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Benjamin hansen <be...@gmail.com> on 2021/07/24 20:32:37 UTC
Hi,
I have read through this post:
https://crunchify.com/how-to-run-java-program-automatically-on-tomcat-startup/
which describes how to automatically start my project under tomcat during
startup.
Basically I have to add this to my web.xml
<servlet>
<servlet-name>CrunchifyTutorials</servlet-name>
<servlet-class>crunchify.com.tutorials.CrunchifyServletExample</servlet-
class>
<load-on-startup>1</load-on-startup>
</servlet>
however the web.xml is generated by maven, so somehow i think i have to put
this into pom.xml which then will instruct maven to add this to the web.xml
file.
So my question is how i should put this into the pom.xml file?
Re: Hi,
Posted by Greg Chabala <gr...@gmail.com>.
https://stackoverflow.com/a/27805058/62462
web.xml is usually provided in source, it is not something that maven or
> any build tool has to generate
>
Never heard of web.xml being generated. Please show us your project if you
think it is.
On Sat, Jul 24, 2021 at 3:32 PM Benjamin hansen <be...@gmail.com>
wrote:
> I have read through this post:
>
> https://crunchify.com/how-to-run-java-program-automatically-on-tomcat-startup/
>
> which describes how to automatically start my project under tomcat during
> startup.
>
> Basically I have to add this to my web.xml
>
>
> <servlet>
> <servlet-name>CrunchifyTutorials</servlet-name>
> <servlet-class>crunchify.com
> .tutorials.CrunchifyServletExample</servlet-
> class>
> <load-on-startup>1</load-on-startup>
> </servlet>
>
> however the web.xml is generated by maven, so somehow i think i have to put
> this into pom.xml which then will instruct maven to add this to the web.xml
> file.
>
> So my question is how i should put this into the pom.xml file?
>