Skip to content

Cannot customize print configuration in a Mapstore project #11612

Description

@sguimmara

Description

I created a Mapstore project with the project generator script (using Mapstore as a submodule). When I try to customize the path to the print configuration using the option -Dmapfish-print-config=/path/to/config.yaml

npm run be:start -- -Dmapfish-print-config="path/to/print/config.yaml"

The option is ignored and the default path is used instead.

How to reproduce

  • Create a Mapstore project with the generator
  • Create a custom config.yaml file
  • Pass the path to this custom config file to the npm run be:start command:
npm run be:start -- -Dmapfish-print-config="path/to/print/config.yaml"

Expected Result

The custom configuration file is used by the print module.

Current Result

The default configuration file is used by the print module.

  • Not browser related
Browser info (use this site: https://www.whatsmybrowser.org/ for non expert users)
Browser Affected Version
Internet Explorer
Edge
Chrome
Firefox
Safari

Other useful information

Activity

  1. added this to the 2026.02.01 milestone on Jul 20, 2026
  2. tdipisa commented on Jul 20, 2026

    @tdipisa
    Member

    @Binabh Can you please double check? Are you able to reproduce this?

  3. Binabh commented on Jul 24, 2026

    @Binabh
    Contributor

    This issue exists and I was able to reproduce this.

    The docs here mentions about

    -Dmapfish-print-config=/etc/mapstore/datadir/printing/config.yaml

    but it does not work like that. I confirmed with

    curl -sS http://localhost:8080/mapstore/pdf/info.json

    Here layouts mentioned in my custom configs are not showing. Default is being used instead.
    But when passed like

    npm run be:start -- \
        -Dbackend.debug.args="-Dmapfish-print-config=/etc/mapstore/datadir/printing/config.yaml"

    It works. Again confirmed with

    curl -sS http://localhost:8080/mapstore/pdf/info.json

    Here layouts mentioned in custom configs showed up.
    So, the problem seems like the args are not correctly forwarded by cargo.

    I see two ways to solve this:

    1. Change code to properly forward params.
    2. Change docs to mention -Dbackend.debug.args=

    Which path should we go @tdipisa @offtherailz ?

  4. offtherailz commented on Jul 24, 2026

    @offtherailz
    Member

    The command referred is intended to be lunched in production envrionment, not in development mode. So it can not be used in npm run:be -- -D... (and the documentation do not mention this command in fact). In dev mode the finding of @Binabh is correct, but most of the times, you don't need to configure this. This is the case you have to load the config at runtime.

    The documentation mentions that MapStore by default gets it from the /printing folder in the root of the generated project.
    If you have a custom project, most of the time you want simply to configure one printing config for the project, that is used all of the times, and deployed with the application itself.
    One way to do that is to change your web/pom.xml this way:

    <resources>
        <resource>
    -        <directory>${basedir}/../MapStore2/java/printing/resources/geoserver/print</directory>
    +        <directory>${basedir}/printing</directory>
            <includes><include>*</include></includes>
        </resource>
    </resources>

    and include your customizations in a /printing directory in your project.

    We can so improve the doc to include this solution, that has not been explicitely mentioned in the doc, I see it is too implicit.
    We can also find alternative strategies for making this easier in the future.

  5. self-assigned this
    on Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions