0

I'd like to install Vaadin 8 in a fresh Eclipse IDE

So I downloaded Eclipse [Oxygen.2 Release (4.7.2) Build id: 20171218-0600], installed it, and from Help/Eclipse Marketplace I loaded the Vaadin Eclipse Plugin 4.0.0.final (changed to 4.0.1 somewhere on the way)

  • Attempt1: Vaadin Docs refer to videos which didn't help: Create new project, enter vaadin-archetype-application, ... Doesn't work: Eclipse doesn't find the archetype, and thus doesn't create a project
  • Attempt 2: Create Vaadin 8 project. This one seems to find the above archetype and creates a project called myapplication, but it has compile errors: Eclipse can't resolve the Vaadin Classes like UI, Button, VaadinRequest etc

Any help or hint is apprecated!

In attempt 2 Eclipse complains about the POM (red markers):

  • Project build error: Non-resolvable parent POM for com.vaadin:vaadin-bom:8.3.1: Failure to transfer com.vaadin:vaadin-parent:pom:1.1.0 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact com.vaadin:vaadin-parent:pom:1.1.0 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org
  • Project build error: 'dependencies.dependency.version' for com.vaadin:vaadin-server:jar is missing. This is what the dependency looks like in the pom.xml which was generated:

    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-server</artifactId>
    </dependency>
    
  • Same error for: vaadin-push, vaadin-client-compile and vaadin-themes

1 Answers1

0

Problem solved. Found 2 solutions.

  • Solution 1: Installed IntelliJ. From the above mentioned error message 'Failure to transfer ...', got the idea that https://repo.maven.apache.org/maven2/ might be a URI to try. IntelliJ presents clear concepts, and thus helped me to find the archetype 'archetype-vaadin-application', under GroupId 'com.vaadin'. So I got a clean compile. Had to guess that the field Command line in the run configuration didn't want the command line content 'mvn jetty:run' but just the goal 'jetty:run'. Then the program ran. Done.
  • Solution 2: In Eclipse (w/ Vaadin Plug-in). New / Project ... / Maven / Maven Project / Next > / Next > / Configure ... (Catalogs). Added Remote Catalog. Catalog file: https://repo.maven.apache.org/maven2/, named it 'Maven Repository'. OK. Brought me back to Window 'New Maven Project'. Chose the name I just invented 'Maven Repository', and some 20.000 archetype appeared. Entered filter 'vaadin' which reduced the list to around 20. Picked 'archetype-vaadin-application'. Got clean compile, but no run config. Created one, chose my Workspace, guessed jetty:run as goal. Build failed. Complained about using a JRE instead of a JDK (jre1.8.0_161). Searched for a place to enter a JDK. Found none. Clicked 'Environments ...', chose JavaSE-1.8, checked jre1.8.0_161 (only choice), ran again. Now the JRE apparently was accepted as JDK. Build was ok. Program ran. Done.

Conclusion:

  • Vaadin is a great tool, but its installation documentation is incomplete and misleading.
  • I will stop using Eclipse, after 16 years. IntelliJ is conceptually much clearer: Using IntelliJ taught me how to make Eclipse do what I needed.
  • 1
    I don't think your assessment is fair. There's no "install" of Vaadin into your IDE since you're supposed to use Maven, Gradle or similar. I would argue that 80-90% of all Java projects use Maven or Gradle and therefore it can hardly be the job of Vaadin docs to explain how this works. Another issue you've run into: Eclipse's support for Maven has - IMO - always been far behind that of NetBeans or IntelliJ. Again, this has nothing to do with Vaadin. – peterh Feb 25 '18 at 13:19
  • Hi Peter, I tried to follow the Vaadin 8 tutorial and it mentioned only installing Eclipse and a JDK. Nothing else. No word about Maven. No word about the Vaadin Plugin. I cannot judge whose fault it is. I only know it doesn't work as described on the Vaadin website. This complaint is still valid today, 11 months later. Only difference: I do not get a clean compile anymore. All the imports of com.vaadin. fail. Also not mentioned in the tutorial. – Martin Rösch Jan 15 '19 at 22:41