Jump to: navigation, search
  • Page
  • Discussion
  • View source
  • History

Scout/Tutorial/3.8/Maven Tycho Build

< Scout‎ | Tutorial‎ | 3.8

Contents

  • 1 Introduction
  • 2 Installation / Prerequisites
    • 2.1 Eclipse
      • 2.1.1 Eclipse for Scout Developers Juno
      • 2.1.2 m2eclipse
      • 2.1.3 Optional: EGit
    • 2.2 Maven
  • 3 Maven Tycho Integration of existing Plugins
  • 4 Build Eclipse Scout Swing client application (building an Eclipse Product)
  • 5 Build Eclipse Scout Server WAR (building an Eclipse Product)
  • 6 Testing an Eclipse Scout Client/Server Application (using JUnit/Maven Tycho Surefire)
    • 6.1 Plugin/Fragment/Feature Setup
    • 6.2 Testing Server
    • 6.3 Testing Shared
    • 6.4 Testing Client
    • 6.5 Debugging a Test
  • 7 Advanced Topics
    • 7.1 Support Rayo Look and Feel for Eclipse Scout
    • 7.2 Support JDBC Drivers for Eclipse Scout
    • 7.3 Integrate the JRE into the client zip
    • 7.4 Bundle client and server together (to support direct client download)

Introduction

This tutorial shows how to build an existing Scout application using Maven Tycho. Therefore we use the Minicrm application as base Scout application to integrate it into the Maven Tycho world.

Installation / Prerequisites

This tutorial assumes that your environment fulfills the following requirements.

Eclipse

Eclipse for Scout Developers Juno

Download-URL: www.eclipse.org/downloads/packages/eclipse-scout-developers/junor

m2eclipse

Updatesite-URL: download.eclipse.org/releases/juno (or download.eclipse.org/technology/m2e/releases)

choose: m2e - Maven Integration for Eclipse	(1.1.0.20120530-0009)
spacer
Old version
Version 1.1.0 is not the current version. Therefore you might need to uncheck "Show only the latest versions of available software" to see this version in the list.


Install m2e connectors: Window > Preferences > Maven > Discovery > Open Catalog

choose: Tycho Configurator

Optional: EGit

Updatesite-URL: download.eclipse.org/releases/juno (or download.eclipse.org/egit/updates)

choose: Eclipse EGit	(2.0.0.201206130900-r)
        Eclipse JGit	(2.0.0.201206130900-r)

Maven

Installation guide: maven.apache.org/download.html#Installation

Maven Tycho Integration of existing Plugins

1. Create new Eclipse Project (used as parent POM)
2. Generate POMs for existing projects / plug-ins
mvn org.eclipse.tycho:tycho-pomgenerator-plugin:generate-poms
    -DgroupId=org.eclipse.minicrm
    -Dversion=1.0.0-SNAPSHOT
    -DextraDirs=../org.eclipse.minicrm.client,../org.eclipse.minicrm.server,../org.eclipse.minicrm.shared,../org.eclipse.minicrm.ui.rap,../org.eclipse.minicrm.ui.swing,../org.eclipse.minicrm.ui.swt

Sample pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="maven.apache.org/POM/4.0.0 maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="maven.apache.org/POM/4.0.0"
    xmlns:xsi="www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.eclipse.scout.autotest</groupId>
    <artifactId>org.eclipse.scout.autotest</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <relativePath>../org.eclipse.scout.autotest.parent/</relativePath>
  </parent>
  <artifactId>org.eclipse.scout.autotest.client</artifactId>
  <packaging>eclipse-plugin</packaging>
</project>
3. Convert every project into a Maven Project: Configure > Convert to Maven Project...
4. [Optional] Resolve Warnings caused by the previous steps (see Problems-View)
  • Delete every bin directory and fix build.properties files (Cause: The project's output folder was changed from /bin to /target/classes)
  • Delete duplicate Maven Coordinates (groupId and version)
5. Extend parent POM configuration
  • Add Eclipse and RAP platform Repositories (using Maven Profiles)
<profiles>
  <profile>
    <id>platform-juno</id>
    <activation>
      <activeByDefault>true</activeByDefault>
      <property>
        <name>platform-version-name</name>
        <value>juno</value>
      </property>
    </activation>
    <properties>
      <eclipse.repo.url>download.eclipse.org/releases/juno</eclipse.repo.url>
      <rap.repo.url>download.eclipse.org/rt/rap/1.5/runtime</rap.repo.url>
      <platform.version>[3.8,3.9)</platform.version>
      <tycho.version>0.15.0</tycho.version>
    </properties>
  </profile>
</profiles>
 
<repositories>
  <repository>
    <id>eclipse platform</id>
    <url>${eclipse.repo.url}</url>
    <layout>p2</layout>
  </repository>
  <repository>
    <id>rap platform</id>
    <url>${rap.repo.url}</url>
    <layout>p2</layout>
  </repository>
</repositories>
  • Replace existing Build settings
<build>
  <plugins>
    <plugin>
      <groupId>org.eclipse.tycho</groupId>
      <artifactId>tycho-maven-plugin</artifactId>
      <version>${tycho.version}</version>
      <extensions>true</extensions>
    </plugin>
 
    <plugin>
      <groupId>org.eclipse.tycho</groupId>
      <artifactId>target-platform-configuration</artifactId>
      <configuration>
        <environments>
          <environment>
            <os>win32</os>
            <ws>win32</ws>
            <arch>x86</arch>
          </environment>
        </environments>
      </configuration>
    </plugin>
  </plugins>
 
  <pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>target-platform-configuration</artifactId>
        <version>${tycho.version}</version>
        <configuration>
          <filters>
            <!-- work around Equinox bug 348045 -->
            <filter>
              <type>p2-installable-unit</type>
              <id>org.eclipse.equinox.servletbridge.extensionbundle</id>
              <removeAll />
            </filter>
          </filters>
        </configuration>
      </plugin>
    </plugins>
  </pluginManagement>
</build>
6. Build parent POM
mvn clean package

Build Eclipse Scout Swing client application (building an Eclipse Product)

1. Create new Eclipse Project (holding the client Product)
2. Add / Create Swing client Product
  • Important: Tycho only supports *.product file in the project root
  • Important: The *.product file has to contain the attribute 'uid' (correspond to the ID field in the Product Configurator view)
3. Create POM configuration
  • pom.xml
<project xmlns="maven.apache.org/POM/4.0.0" xmlns:xsi="www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="maven.apache.org/POM/4.0.0 maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.eclipse.minicrm</groupId>
    <artifactId>org.eclipse.minicrm</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <relativePath>../org.eclipse.minicrm/</relativePath>
  </parent>
  <artifactId>org.eclipse.minicrm.swing.product</artifactId>
  <packaging>eclipse-repository</packaging>
 
  <properties>
    <product.id>org.eclipse.minicrm.swing</product.id>
    <product.outputDirectory>${project.build.directory}/products/${product.id}/win32/win32/x86</product.outputDirectory>
    <product.finalName>minicrm</product.finalName>
  </properties>
 
  <build>
    <plugins>
      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-p2-director-plugin</artifactId>
        <executions>
          <execution>
            <id>materialize-products</id>
            



gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.