vaadinvaadin-flowvaadin14vaadin-charts

Vaadin 14 Flow charts to SVG generator dependencies not working in pom.xml


I'm trying to implement the Vaadin Flow (14) charts to SVG converter and the pom dependencies are failing. The instructions I'm following are at: https://vaadin.com/docs/v14/ds/components/charts/charts-installing to install Charts as well as: https://vaadin.com/docs/latest/ds/components/charts/java-api/installing I'm then using these instructions to convert the charts to export them to SVG files: https://vaadin.com/docs/latest/ds/components/charts/java-api/svg-generator

With that in mind I've added the following to my pom.xml file:

<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-charts-flow</artifactId>
</dependency>
<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-charts-flow-svg-generator</artifactId>
</dependency>

The instructions say to leave out the version but the SVG generator dependencies fails saying it requires a version. I then add the version number as stated in the documentation: <version>6.0.0</version>This results in the following error: com.vaadin:vaadin-charts-flow-svg-generator:jar:6.0.0 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. And as I suspect this will be the first answer yes I do have the vaadin-addons repository added to the pom file. I'm actually using the default project constructed from https://start.vaadin.com/app which includes the vaadin-addons by default.

My final version in the pom was:

<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-charts-flow</artifactId>
    <version>6.0.0</version>
</dependency>
<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-charts-flow-svg-generator</artifactId>
    <version>6.0.0</version>
</dependency>

Solution

  • I didn't try the latest version of Charts with Vaadin 14, but you have an upgrade guide here: https://vaadin.com/docs/v14/ds/components/charts/upgrading

    The versioning has been changed for Vaadin 20+ and now the components have the same version as Vaadin:

    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-charts-flow</artifactId>
        <version>21.0.0.alpha10</version>
    </dependency>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-charts-flow-svg-generator</artifactId>
        <version>21.0.0.alpha10</version>
    </dependency>
    

    As it's an alpha version you also need to add the pre-release repository:

     <repository>
          <id>vaadin-prereleases</id>
          <url>
               https://maven.vaadin.com/vaadin-prereleases/
           </url>
     </repository>