Quantcast

How to set user.timezone within tomcat-maven-plugin

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to set user.timezone within tomcat-maven-plugin

kennardconsulting
Hi guys,

First, thanks for a great plugin in 'tomcat-maven-plugin': being able to declaratively start and stop a tomcat server is awesome!

I have hit a snag with porting my integration tests over from Ant: I need to be able to set -Duser.timezone=GMT on my VM. How can I do this within tomcat-maven-plugin? I tried using <systemProperties> but to no avail?

Here is what I tried:

<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>tomcat-maven-plugin</artifactId>
        <version>1.1</version>
        <configuration>
                <fork>true</fork>
                <port>8081</port>
                <warFile>target/${finalName}.war</warFile>
                <systemProperties>
                        <user.timezone>GMT</user.timezone>
                        <user.region>US</user.region>
                </systemProperties>
        </configuration>
        <executions>
                <execution>
                        <id>start-tomcat</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                                <goal>run-war</goal>
                        </goals>
                </execution>
        </executions>
</plugin>

Regards,

Richard.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to set user.timezone within tomcat-maven-plugin

Olivier Lamy
Hello,
Uhm it's probably too late to setup this in the plugin as the jvn has
already been started.

Maybe it will works with : MAVEN_OPTS="-Duser.timezone=GMT"

HTH,
--
Olivier Lamy
http://twitter.com/olamy
http://www.linkedin.com/in/olamy

2011/2/27 kennardconsulting <[hidden email]>:

>
> Hi guys,
>
> First, thanks for a great plugin in 'tomcat-maven-plugin': being able to
> declaratively start and stop a tomcat server is awesome!
>
> I have hit a snag with porting my integration tests over from Ant: I need to
> be able to set -Duser.timezone=GMT on my VM. How can I do this within
> tomcat-maven-plugin? I tried using <systemProperties> but to no avail?
>
> Here is what I tried:
>
> <plugin>
>        <groupId>org.codehaus.mojo</groupId>
>        <artifactId>tomcat-maven-plugin</artifactId>
>        <version>1.1</version>
>        <configuration>
>                <fork>true</fork>
>                <port>8081</port>
>                <warFile>target/${finalName}.war</warFile>
>                <systemProperties>
>                        <user.timezone>GMT</user.timezone>
>                        <user.region>US</user.region>
>                </systemProperties>
>        </configuration>
>        <executions>
>                <execution>
>                        <id>start-tomcat</id>
>                        <phase>pre-integration-test</phase>
>                        <goals>
>                                <goal>run-war</goal>
>                        </goals>
>                </execution>
>        </executions>
> </plugin>
>
> Regards,
>
> Richard.
> --
> View this message in context: http://old.nabble.com/How-to-set-user.timezone-within-tomcat-maven-plugin-tp31024393p31024393.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
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to set user.timezone within tomcat-maven-plugin

kennardconsulting
Olivier,

Many thanks for your reply!

Because I was using <fork>true</fork>, I was hoping I would be getting a new JVM and so could set the user.timezone on that new instance. Is that not the case?

Regards,

Richard.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to set user.timezone within tomcat-maven-plugin

Olivier Lamy
Hello,

In fact it's not a real fork which start a new jvm.
If fork = true, the mojo doesn't wait indefinitely and let the maven
lifecycle continue (as it the tomcat shutdown with maven)

--
Olivier Lamy
http://twitter.com/olamy
http://www.linkedin.com/in/olamy

2011/2/27 kennardconsulting <[hidden email]>:

>
> Olivier,
>
> Many thanks for your reply!
>
> Because I was using <fork>true</fork>, I was hoping I would be getting a new
> JVM and so could set the user.timezone on that new instance. Is that not the
> case?
>
> Regards,
>
> Richard.
> --
> View this message in context: http://old.nabble.com/How-to-set-user.timezone-within-tomcat-maven-plugin-tp31024393p31026883.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
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to set user.timezone within tomcat-maven-plugin

kennardconsulting
Great. Thanks for your informative answers, Olivier!

Regards,

Richard.
Loading...