简体   繁体   中英

Import component from add-on directory

I am using Vaadin version 21.0.7 with Spring Boot and i want to import Paginator add-on. I have added addon's groupId in applicaton.properties as follows: vaadin.whitelisted-packages=com.test.demo,com.vaadin.componentfactory. The problem is that i get the following error: Paginator cannot be resolved to a type.

Some questions you may want to update your question with answers to:

  • Are you using Maven? Gradle? Something else?
  • JDK version?
  • Is the error a compile-time one? If so, you should add the full output to your question.

Now, for a potential solution:

Assuming you are using Maven...

(1) Make sure that Maven resolved the dependency.

Your IDE should tell you if not, or you can check your local .m2 directory. On Windows, it is located at ${user.home} . On macOS and most Unix/Linux distributions, it is located at ~ . Check .m2/repositories/com/vaadin/componentfactory/paginator/<version>/ and ensure that the JARs were downloaded.

If they were not, make sure you

(a) defined the Vaadin Addons repository in your POM, eg,

<repositories>
    <repository>
        <id>vaadin-addons</id>

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

    <repository>
        <id>central</id>

        <url>https://repo1.maven.org/maven2/</url>
    </repository>
</repositories>

(b) and defined the dependency, eg,

<dependencies>
    <dependency>
        <groupId>com.vaadin.componentfactory</groupId>
        <artifactId>paginator</artifactId>
        <version>2.0.0</version>
    </dependency>
</dependencies>

(2) Are you using Jigsaw (Java 9+ modules)?

If you are, make sure you specified the dependency:

module myModule {

  requires paginator;

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM