Enable productionMode via Maven build

Hello,

is it possible to enable productionMode in Maven buidl?

By now i found out only following to enable productionMode:

  • web.xml → context-param or inti-param
  • code → @VaadinServletConfiguration(productionMode = false)

Note: I cann’t find any online documentation for “vaadin-maven-plugin” :frowning: I expected somohow, that this plugin could do this job.

Hi,

I didn’t try, but found some alternatives:

  1. Use multiple
    web.xml
    files and the
    maven-war-plugin
    as described
    here
    .
  2. Launch the application using a Maven plugin that supports setting system properties (e.g.

    jetty-maven-pluggin

    ), defining one of such properties,
    programatically reading that property
    , and seting the production mode as described
    here
    .
  3. Use
    Filtering
    to process
    web.xml
    .

You will probably want to use Maven variables and profiles with the previous methods.

Hi,

thank you for your answer.

I solved this using Filtering in web.xml (point 3.).
Using Maven Profiles (1. point) is also quite interesting .

… but i would still expect that Vaadin Maven plugin can do this and there is no need to do somev Maven tricks.

BR,
Lubos