Showing posts with label Tycho. Show all posts
Showing posts with label Tycho. Show all posts

Friday, November 20, 2020

Add Code Coverage Reports to Eclipse, Maven, and Jenkins

Code coverage may provide some insights in your tests. They show which classes, lines of codes, and conditional branches are called by your tests. A high percentage of coverage does not automatically mean that your tests are great - as you might not have a single assertion in your test code - but at least they can give you an impression of dark areas in your code base.

This article is heavily based on the article of Lorenzo Bettini on JaCoCo Code Coverage and Report of multiple Eclipse plug-in projects, so the credits for this setup are his!

Step 1: Eclipse IDE Setup

Coverage in Java projects is typically tracked with the JaCoCo library. The according plugin for Eclipse is called EclEmma and is available via the Eclipse Marketplace.

After installation you have a new run target 

that adds coverage information to your execution. Only thing to do is to rerun your unit tests and check out the Coverage view.


Multiple coverage sessions can be combined into one. That allows to accumulate the results of multiple unit tests into a single coverage report.

Step 2: Tycho integration

For the next steps I expect that you basically followed my tycho tutorials and have a similar setup.

First we need to enable JaCoCo in our builds:

	<build>
		<plugins>
			<!-- enable JaCoCo code coverage -->
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>0.8.6</version>

				<configuration>
					<output>file</output>
				</configuration>

				<executions>
					<execution>
						<id>jacoco-initialize</id>
						<phase>pre-integration-test</phase>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

Tycho surefire executes unit tests in the maven integration-test phase, therefore we start the agent right before. This plugin needs to be active for any plugin of type eclipse-plugin-test (see tycho tutorial), but it is safe to put it in the master pom of your *.releng project.

Now each test run creates coverage reports. For analysis purposes we need to merge them into a single one. Therefore create a new General/Project in your workspace, named *.releng.coverage. In the pom.xml file we need to add a step to aggregate all reports into one:

	<build>
		<plugins>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>${jacoco.version}</version>
				<executions>
					<execution>
						<phase>verify</phase>
						<goals>
							<goal>report-aggregate</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

Afterwards we need to define dependencies for the projects containing our source code:

	<dependencies>
		<!-- Code dependencies to show coverage on -->
		<dependency>
			<groupId>com.example</groupId>
			<artifactId>com.example.plugin1</artifactId>
			<version>0.1.0-SNAPSHOT</version>
			<scope>compile</scope>
		</dependency>

		<dependency>
			<groupId>com.example</groupId>
			<artifactId>com.example.plugin2</artifactId>
			<version>0.1.0-SNAPSHOT</version>
			<scope>compile</scope>
		</dependency>
		...
	</dependencies>

Further we need dependencies to our test fragments (mind the different scope) :

	<dependencies>
		...
		<!-- Test dependencies -->
		<dependency>
			<groupId>com.example</groupId>
			<artifactId>com.example.project1.test</artifactId>
			<version>0.1.0-SNAPSHOT</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>com.example</groupId>
			<artifactId>com.example.project2.test</artifactId>
			<version>0.1.0-SNAPSHOT</version>
			<scope>test</scope>
		</dependency>
		...
	</dependencies>

If unsure, have a look at a complete pom file.

Finally add the new project as a module to your master pom:

	<modules>
		...
		<module>../your.project.releng.coverage</module>
		...
	</modules>

The maven build now generates *.releng.coverage/target/site/jacoco-aggregate/jacoco.xml which can be picked up by various tools. Further you get a nice HTML report in the same folder for free.

Step 3: Jenkins reports

While you may directly publish the HTML report on your jenkins builds, I prefer to use the Code Coverage plugin. With a single instruction in your pipeline

	publishCoverage adapters: [jacocoAdapter(path: 'releng/com.example.releng.coverage/target/site/jacoco-aggregate/jacoco.xml')], sourceFileResolver: sourceFiles('STORE_LAST_BUILD')

it generates nice, interactive reports like these:

You may also have a look at this live report to play around with.

Monday, April 24, 2017

Host your own eclipse signing server

We handled signing plugins with tycho some time ago already. When working in a larger company you might want to keep your certificates and passphrases hidden from your developers. For such a scenario a signing server could come in handy.

The eclipse CBI project provides such a server which just needs to get configured in the right way. Mikael Barbero posted a short howto on the mailing list, which should contain all you need. For a working setup example follow this tutorial.

To have a test vehicle for signing we will reuse the tycho 4 tutorial source files.

Step 1: Get the service

Download the latest service snapshot file and store it to a directory called signingService. Next download the test server, we will use it to create a temporary certificate and keystore.

Finally we need a template configuration file. Download it and store it to signingService/jar-signing-service.properties.

Step 2: A short test drive

Open a console and change into the signingService folder. There execute:
java -cp jar-signing-service-1.0.0-20170331.204711-10.jar:jar-signing-service-1.0.0-20170331.204711-10-tests.jar org.eclipse.cbi.webservice.signing.jar.TestServer
You should get some output giving you the local address of the signing service as long as the certificate store used:
Starting test signing server at http://localhost:3138/jarsigner
Dummy certificates, temporary files and logs are stored in folder: /tmp/TestServer-2590700922068591564
Jarsigner executable is: /opt/oracle-jdk-bin-1.8.0.121/bin/jarsigner
We are not ready yet to sign code, but at least we can test if the server is running correctly. If you try to connect with a browser you should get a message that HTTP method GET is not supported by this URL.

Step 3: Preparing the tycho project

We need some changes to our tycho project so it can make use of the signing server. Get the sources of the tycho 4 tutorial (checking out from git is fully sufficient) and add following code to com.codeandme.tycho.releng/pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

 <properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 </properties>

 <pluginRepositories>
  <pluginRepository>
   <id>cbi</id>
   <url>https://repo.eclipse.org/content/repositories/cbi-releases/</url>
  </pluginRepository>
 </pluginRepositories>

 <build>
  <plugins>
   <!-- enable jar signing -->
   <plugin>
    <groupId>org.eclipse.cbi.maven.plugins</groupId>
    <artifactId>eclipse-jarsigner-plugin</artifactId>
    <version>${eclipse.jarsigner.version}</version>
    <executions>
     <execution>
      <id>sign</id>
      <goals>
       <goal>sign</goal>
      </goals>
      <phase>verify</phase>
     </execution>
    </executions>
    <configuration>
     <signerUrl>http://localhost:3138/jarsigner</signerUrl>
    </configuration>
   </plugin>
   
  </plugins>
 </build>
</project>
The code above shows purely additions to the pom.xml, no sections were removed or replaced.

You may try to build your project with maven already. As I had problems to connect to https://timestamp.geotrust.com/tsa my local build failed, even if maven reported SUCCESS.

Step 4: Configuring a productive instance

So lets get productive. Setting up your keystore with your certificates will not be handled by this tutorial, so I will reuse the keystore created by the test instance. Copy the keystore.jks file from the temp folder to the signingService folder. Then create a text file keystore.pass:
echo keystorePassword >keystore.pass

Now we need to adapt the jar-signing-service.properties file to our needs:
### Example configuration file

server.service.pathspec=/jarsigner
server.service.pathspec.versioned=false

jarsigner.bin=/opt/oracle-jdk-bin-1.8.0.121/bin/jarsigner

jarsigner.keystore=/somewhere/signingService/keystore.jks
jarsigner.keystore.password=/somewhere/signingService/keystore.pass
jarsigner.keystore.alias=acme.org

jarsigner.tsa=http://timestamp.entrust.net/TSS/JavaHttpTS

  • By setting the versioned flag to false in line 4 we simplify the service web address (details can be found in the sample properties file).
  • Set the jarsigner executable path in line 6 according to your local environment.
  • Lines 8-10 contain details about the keystore and certificate to use, you will need to adapt them, but above settings should result in a working build.
  • The change in line 12 was necessary at the time of writing this tutorial because of connection problems to https://timestamp.geotrust.com/tsa.
Run your service using
java -jar jar-signing-service-1.0.0-20170331.204711-10.jar
Remember that your productive instance now runs on port 8080, so adapt your pom.xml accordingly.

Monday, October 5, 2015

Tycho 13: Generating API documentation

If you want to add API documentation to your feature you want to make sure that documentation and implementation are consistent. Running javadoc manually is not ideal, better integrate documentation generation in your tycho build.

Tycho Tutorials

For a list of all tycho related tutorials see Tycho Tutorials Overview

Source code for this tutorial is available on github as a single zip archive, as a Team Project Set or you can browse the files online.

Step 1: Create a help plug-in

We need a hosting plug-in for our API documentation. So create a new Plug-in Project named com.codeandme.tycho.help and mavenize it with Packaging set to eclipse-plugin. Add it to your master pom as usual.

Eclipse help is provided by adding extension points for org.eclipse.help.toc elements and according xml files. I will not go into details here as Lars did an excellent job with his tutorial on eclipse help.

For our project we provide 2 'classic' toc entries along with xml files: main.xml and reference.xml.

The third entry in plugin.xml (referring to help/api_docs.xml) does not have a corresponding xml file as we will create this one on the fly with maven.

We intend to generate documentation to a folder help/api-docs/javadoc. As tycho will not create this folder automatically, we need to add it manually.

Step 2: Configuring tycho

Documentation creation is a step we want to do for the help plug-in only. Therefore the following changes will go to com.codeandme.tycho.help/pom.xml and not to our master pom.
 <properties>
  <platform.api>org.eclipse.platform.doc.isv/reference/api</platform.api>
 </properties>

 <build>
  <plugins>
   <plugin>
    <groupId>org.eclipse.tycho.extras</groupId>
    <artifactId>tycho-document-bundle-plugin</artifactId>
    <version>${tycho.extras.version}</version>
    <executions>
     <execution>
      <id>eclipse-javadoc</id>
      <phase>generate-resources</phase>
      <goals>
       <goal>javadoc</goal>
      </goals>
      <configuration>
       <outputDirectory>${project.basedir}/help/api-docs/javadoc</outputDirectory>
       <tocFile>${project.basedir}/help/api_docs.xml</tocFile>
       <tocOptions>
        <mainLabel>Tycho Tutorial API</mainLabel>
       </tocOptions>
       <javadocOptions>
        <!-- enable in case you need a proxy for web access 
        <jvmOptions>
         <jvmOption>-Dhttp.proxySet=true</jvmOption>
         <jvmOption>-Dhttp.proxyHost=proxy.example.com</jvmOption>
         <jvmOption>-Dhttp.proxyPort=81</jvmOption>
         <jvmOption>-DhttpnonProxyHosts=*.example.com</jvmOption>
        </jvmOptions>
         -->
        <additionalArguments>
         <additionalArgument>${javadoc-args}</additionalArgument>
         <additionalArgument>
          -link
          http://docs.oracle.com/javase/8/docs/api/
         </additionalArgument>
         <additionalArgument>
          -linkoffline
          ../../${platform.api}
          http://help.eclipse.org/mars/topic/org.eclipse.platform.doc.isv/reference/api/
         </additionalArgument>
         <additionalArgument>-public</additionalArgument>
        </additionalArguments>
       </javadocOptions>
      </configuration>
     </execution>
    </executions>
   </plugin>
  </plugins>
 </build>
The property tycho.extras.version was added in our previous tutorial. Please add it to the master pom, if you did not do this already.

Lets look at some of the pom options:

Line 20 defines the TOC xml file to be created. Its display name is defined in line 22. TOC generation might be disabled by setting <skipTocGen>false</skipTocGen>
Lines 35-38 will add links to external documentation for standard java classes.
Lines 39-43 will add links to the eclipse API documentation typically shipped with every release.

Step 3: Define plug-ins for documentation creation

Typically you do not want to create documentation for all plug-ins. Test plug-ins for example should not show up there. Therefore we need to maintain a list of all plug-ins that should be considered by tycho.

This list is stored in com.codeandme.tycho.help/build.properties. Add them as extra classpath entries:
jars.extra.classpath = platform:/plugin/com.codeandme.tycho.plugin
To provide multiple plug-ins, add a comma-separated list (like for the bin.includes entry).

Tycho will create documentation for exported packages only. With the current project configuration com.codeandme.tycho.plugin does not export anything. You have to export a package there or tycho will fail to build.

Finally make sure to add the help folder to your binary build in build.properties.

Congratulations, you API documentation is now up to date for every build.

Thursday, October 1, 2015

Tycho 12: Build source features

Providing update sites containing source code for developers is considered good style. Used in a target platform it allows developers to see your implementation code. This makes debugging far easier as users do not need to checkout your source code from repositories they have to find first.

Tycho allows to package such repositories very easily.

Tycho Tutorials

For a list of all tycho related tutorials see Tycho Tutorials Overview

Source code for this tutorial is available on github as a single zip archive, as a Team Project Set or you can browse the files online.


Step 1: Create a source update site project

Create a new project of type Plug-in Development/Update Site Project. Name it com.codeandme.tycho.releng.p2.source and leave all the other settings to their defaults. You will end up in the Site Manifest Editor of your site.xml file. Instead of editing this file by hand we will immediately delete site.xml and copy over the category.xml file from com.codeandme.tycho.releng.p2.

Mavenize the project the same way as we did in tutorial 5: set Packaging to eclipse-repository and add the project to com.codeandme.tycho.releng/pom.xml.

Step 2: Modify category.xml

Source plug-ins and features will be created by tycho on the fly, so we have no real projects in the workspace we could add with the Site Manifest Editor. Therefore we need to open category.xml with the Text Editor. Tycho does not care about the url property, so remove it. Feature ids need to be changed to <original.id>.source.

If you like you can move all source features to a dedicated category:
<?xml version="1.0" encoding="UTF-8"?>
<site>
   <feature id="com.codeandme.tycho.plugin.feature" version="1.0.0.qualifier">
      <category name="source_components"/>
   </feature>
   <category-def name="source_components" label="Developer Resources"/>
</site>
Step 3: Configure tycho source builds

To enable source builds we need to extend com.codeandme.tycho.releng/pom.xml a bit. The source below contains only the additions to our pom file, so merge them accordingly (full version on github).
 <properties>
  <tycho.extras.version>${tycho.version}</tycho.extras.version>
 </properties>

 <build>
  <plugins>
   <!-- enable source feature generation -->
   <plugin>
    <groupId>org.eclipse.tycho.extras</groupId>
    <artifactId>tycho-source-feature-plugin</artifactId>
    <version>${tycho.extras.version}</version>

    <executions>
     <execution>
      <id>source-feature</id>
      <phase>package</phase>
      <goals>
       <goal>source-feature</goal>
      </goals>
     </execution>
    </executions>

    <configuration>
     <excludes>
      <!-- provide plug-ins not containing any source code -->
      <plugin id="com.codeandme.tycho.product" />
     </excludes>
    </configuration>
   </plugin>

   <plugin>
    <groupId>org.eclipse.tycho</groupId>
    <artifactId>tycho-source-plugin</artifactId>
    <version>${tycho.version}</version>

    <executions>
     <execution>
      <id>plugin-source</id>
      <goals>
       <goal>plugin-source</goal>
      </goals>
     </execution>
    </executions>
   </plugin>

   <plugin>
    <groupId>org.eclipse.tycho</groupId>
    <artifactId>tycho-p2-plugin</artifactId>
    <version>${tycho.version}</version>
    <executions>
     <execution>
      <id>attached-p2-metadata</id>
      <phase>package</phase>
      <goals>
       <goal>p2-metadata</goal>
      </goals>
     </execution>
    </executions>
   </plugin>
  </plugins>
 </build>
When building source plug-ins, tycho expects every plug-in project to actually contain source code. If projects do not contain source, we need to exclude them as we do on line 26.

After building the project we will end up with a p2 site containing binary builds and source builds of each feature/plug-in.

Wednesday, June 4, 2014

Tycho 11: Install root level features


Introduction

Do you know about root level features?

Components installed in eclipse are called installable units (IUs). These are either features or products. Now IUs might be containers for other features, creating a tree like dependency structure. Lets take a short look at the Installation Details (menu Help / About Eclipse) of our sample product from tycho tutorial 8:

We can see that there exists one root level feature Tycho Built Product which contains all the features we defined for our product. What is interesting is, that the Update... and Uninstall... buttons at the bottom are disabled when we select child features.

So in an RCP application we may only update/uninstall root level features. This means that if we want to update a sub component, we need to create a new version of our main product. For a modular application this might not be a desired behavior.

The situation changes when a user installs additional components into a running RCP application. Such features will be handled as root level features and can therefore be updated separately. So our target will be to create a base product and install our features in an additional step.

Great news is, that tycho 0.20.0 allows us to do this very easily.

Tycho Tutorials

For a list of all tycho related tutorials see Tycho Tutorials Overview

Source code for this tutorial is available on github as a single zip archive, as a Team Project Set or you can browse the files online.

Step 1: Identify independent features

Tycho will do all the required steps for us, we only need to identify features to be installed at root level. So open your product file using either the Text Editor or XML Editor. Locate the section with the feature definitions. Now add an installMode="root" attribute to any feature to be installed on root level.
   <features>
      <feature id="org.eclipse.e4.rcp"/>
      <feature id="org.eclipse.platform"/>
      <feature id="com.codeandme.tycho.plugin.feature" installMode="root"/>
      <feature id="com.codeandme.tycho.product.feature"/>
      <feature id="org.eclipse.help" installMode="root"/>
      <feature id="org.eclipse.emf.ecore"/>
      <feature id="org.eclipse.equinox.p2.core.feature"/>
      <feature id="org.eclipse.emf.common"/>
      <feature id="org.eclipse.equinox.p2.rcp.feature"/>
      <feature id="org.eclipse.equinox.p2.user.ui"/>
      <feature id="org.eclipse.rcp"/>
      <feature id="org.eclipse.equinox.p2.extras.feature"/>
   </features>

Make sure to update the tycho version to be used to 0.20.0 or above.

Nothing more to do, build your  product and enjoy root level features in action.


Wednesday, July 17, 2013

Tycho 10: Signing plugins and executables

Eclipse supports signed plugins and displays this information in its Installation Details. On Mac and Windows you might further want to sign your executable to get rid of potential warnings when launching your application. All this can be done automatically with tycho. To get a general overview how to build a product with tycho, see my previous tutorials on this topic:

Tycho Tutorials

For a list of all tycho related tutorials see Tycho Tutorials Overview

Source code for this tutorial is available on github as a single zip archive, as a Team Project Set or you can browse the files online.

Before we start signing stuff, we need a certificate. In our example, we will use a self-signed certificate, you will probably want to go for one from a certification authority.

Step 1: Creating a self signed certificate

There exist lots of tutorials out there, how to sign jar files with a self-signed certificate. I suggest you pick one and try to sign a jar file for test purposes. Here are the two commands needed to create the certificate, which can be executed in a shell:
$JAVA_HOME/bin/keytool -genkey -keyalg RSA -sigalg SHA1withRSA -keystore C:\userdata\workspaces\blog\com.codeandme.tycho.releng\sample.keystore -alias eve -dname "CN=Eve, OU=none, O=example, L=somewhere, ST=earth, C=ea, EMAILADDRESS=eve@example.com"

Enter keystore password: verystrong
Re-enter new password: verystrong
Enter key password for <eve>
        (RETURN if same as keystore password): secret
Re-enter new password: secret

$JAVA_HOME/bin/keytool -selfcert -keystore C:\userdata\workspaces\blog\com.codeandme.tycho.releng\sample.keystore -alias eve
(I always preferred Eve over Alice and Bob...)

The email address field seems to be necessary (thanks for the comment), see this message on stackoverflow

Step 2: Signing jar files with tycho

Signing will be done by the maven-jarsigner-plugin. Open the master pom located in com.codeandme.tycho.releng (see previous tutorials) and add following plugin section to it.
   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jarsigner-plugin</artifactId>
    <version>1.2</version>
    <configuration>
     <keystore>${basedir}/../com.codeandme.tycho.releng/blog.keystore</keystore>
     <storepass>verystrong</storepass>
     <alias>eve</alias>
     <keypass>secret</keypass>
    </configuration>
    <executions>
     <execution>
      <id>sign</id>
      <goals>
       <goal>sign</goal>
      </goals>
     </execution>
    </executions>
   </plugin>
Set your passwords and the path to your keystore and run your maven build. Congratulations, you have signed your jars successfully.

Step 3: Create a code signing certificate for windows

Creating a self-signed certificate for your windows executable is not very useful unless you add your CA (we will create this in a second) to the trusted root certificates on the target machines. So this might be valid for a setup in a closed environment but not when your software is downloaded from the internet. In the latter case you need to buy a certificate from one of the big CAs (see this thread for some cheap ones).

Nevertheless for our test purposes such a certificate will do, so lets create one following this description on stackoverflow. We need to install Windows SDK, so download and run the installer. On the Install Options page select Windows Native Code Development/Tools, we do not need anything else for signing. After the installer is done you should find signtool.exe in C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin.

To create a code signing certificate, startup a command shell:
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\makecert.exe" -r -pe -n "CN=Eve" -ss CA -sr CurrentUser -a sha256 -cy authority -sky signature -sv SampleCA.pvk SampleCA.cer
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\makecert.exe" -pe -n "CN=Eve" -a sha256 -cy end -sky signature -ic SampleCA.cer -iv SampleCA.pvk -sv SampleSPC.pvk SampleSPC.cer
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\pvk2pfx.exe" -pvk SampleCA.pvk -spc SampleCA.cer -pfx SampleCA.pfx
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\signtool.exe" sign /v /f SampleCA.pfx /t http://timestamp.verisign.com/scripts/timstamp.dll Application.exe
  • Line 1 creates a root CA. You will be asked for a Subject Key twice. This is the key for your CA. Lets use "verystrong".
  • Line 2 creates a signing certificate using the root CA. The Subject Key is now the key for our signing certificate. So use a different one to that before (eg. "secret"). You will also be asked for an Issuer Signature, which refers to the Subject Key of step 1 ("verystrong").
  • Line 3 converts our certificate into pfx format. Again you need the Subject Key of step 1 ("verystrong").
  • Line 4 signs a fictional file Application.exe with our key.

To verify that signing worked you can open the Properties dialog of your executable and examine Digital Signatures.
    Step 4: Integrate signing in maven build

    For signing our executable we need to run the external signtool.exe by using the exec-maven-plugin. Open com.example.tycho.releng.product/pom.xml and add a new plugin section with following content:
       <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.2.1</version>
        <executions>
         <execution>
          <id>exec</id>
          <phase>package</phase>
          <goals>
           <goal>exec</goal>
          </goals>
         </execution>
        </executions>
        <configuration>
         <executable>C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\signtool.exe</executable>
         <arguments>
          <argument>sign</argument>
          <argument>/v</argument>
          <argument>/f</argument>
          <argument>C:\UserData\Workspaces\Blog\om.codeandme.tycho.releng\SampleCA.pfx</argument>
          <argument>/t</argument>
          <argument>http://timestamp.verisign.com/scripts/timstamp.dll</argument>
          <argument>${project.build.directory}\products\tycho.product\win32\win32\x86\eclipse.exe</argument>
         </arguments>
        </configuration>
       </plugin>
    
    Make sure you have no line breaks in your xml nodes!

    For MacOS this should work similar. To my knowledge you would just have to use another signing application.

    Monday, January 7, 2013

    Tycho build 9: Updating version numbers

    When you start releasing your products you need to start dealing with version numbering of your plug-ins and features. It is generally a good idea to do this the eclipse way. When you use API Tooling and API baselines eclipse will automatically tell you when to increase your versions. The problem is: once you increase your plug-in version number you have to adapt your maven version too. Otherwise your build will fail.

    Keeping version numbers consistent is a tedious task. But help is on the way: let tycho do this for you!

    Tycho Tutorials

    For a list of all tycho related tutorials see Tycho Tutorials Overview

    Source code for this tutorial is available on github as a single zip archive, as a Team Project Set or you can browse the files online.

    Step 1: Add tycho-versions plugin

    Open your master pom file and add a new plugin section within the project/build/plugins node:
       <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-versions-plugin</artifactId>
        <version>${tycho.version}</version>
       </plugin>
    

    Step 2: Execute new maven target

    Go to the project com.codeandme.tycho.releng, right click and select Run As/Maven build.... Set tycho-versions:update-pom in Goals and execute maven. Now all your pom file version numbers will be updated according to the plug-in and feature version numbers.

    Tycho build 8: Using a target platform

    A target platform describes, which features and plug-ins are used to build your product. It further defines where to look for those components.

    Using a target platform makes your build reproducible and therefore predictable. Try to use it right from the beginning of your product development.

    Tycho Tutorials

    For a list of all tycho related tutorials see Tycho Tutorials Overview

    Source code for this tutorial is available on github as a single zip archive, as a Team Project Set or you can browse the files online.

    Step 1: Creating a target platform

    The target file editor in Eclipse is somewhat 'special'. It has its rough edges. If you would like to avoid them I strongly suggest to use the Target Platform Definition DSL and Generator from Mikael Barbero. You need to install it in your IDE, but it will ease your life, trust me. For the next steps I assume you installed the plugin.


    Create a new General/Project named com.codeandme.tycho.releng.targetplatform. Now create a new file named com.codeandme.tycho.releng.targetplatform.tpd within that project. Set the content to:
    target "Tycho Tutorial" with source requirements
    
    location "http://download.eclipse.org/releases/mars/" eclipse-mars {
     org.eclipse.platform.feature.group
     org.eclipse.rcp.feature.group
     org.eclipse.jdt.feature.group
     org.eclipse.equinox.p2.discovery.feature.feature.group
     org.eclipse.equinox.executable.feature.group
    }
    
    After saving select the file in the Project Explorer and select Create Target Definition File from the context menu. A .target file will be generated for you. Now open the .target file in the Target Editor and wait for the components to be loaded. Afterwards click the link in the upper right corner Set as Target Platform to activate it.

    A full workspace build is triggered by that action. If all your dependencies can be resolved you should see no error markers on our projects.

    Make sure that your target file follows the naming scheme <project name>.target otherwise tycho will not be able to pick it up.

    Step 2: Integrate in maven build

    Convert the project to a maven project with Packaging set to eclipse-target-definition. Then add it to your master pom. Now we need to change the master pom a little: remove the repositories section as we want to use our target platform instead of the Mars repository. To activate the target definition in maven modify the existing plugin section:

       <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>target-platform-configuration</artifactId>
        <version>${tycho.version}</version>
        <configuration>
         <target>
          <artifact>
           <groupId>tycho_example</groupId>
           <artifactId>com.codeandme.tycho.releng.targetplatform</artifactId>
           <version>1.0.0-SNAPSHOT</version>
          </artifact>
         </target>
         <environments>
          <environment>
           <os>win32</os>
           <ws>win32</ws>
           <arch>x86</arch>
          </environment>
         </environments>
        </configuration>
       </plugin>
    If you followed my previous tutorials you will only need to add the target section as the rest should already be part of your pom file. The target/artifact/artifactId node refers to the name of the project, that contains the target definition file.

    Your build now uses the target definition.

    Optional: Mirror settings for a target platform

    The location line in tpd files takes an id as last parameter. In our example it is eclipse-mars. This is the id to refer to in your maven mirror settings. So point your mirrorOf parameter in your settings.xml file to eclipse-mars.

    Tycho build 7: Plug-in unit tests

    During the previous tutorials we focused on building stuff from our productive code. But good development is test driven and requires a lot of unit testing. Tycho can integrate tests in the build process which automatically gives you test coverage on every build you do.

    Tycho Tutorials

    For a list of all tycho related tutorials see Tycho Tutorials Overview

    Source code for this tutorial is available on github as a single zip archive, as a Team Project Set or you can browse the files online.

    Step 1: Create a sample unit test

    Unit tests for plug-ins should normally be provided as a fragment to the plug-in under test. Fragments allow to access all classes of the main plug-in without exporting them. If you use the same package name for your unit test class and the class under test you can even access package private methods.

    Create a new Fragment Project named com.codeandme.tycho.plugin.test. Set the Host Plug-in ID to com.codeandme.tycho.plugin and adjust the version ranges accordingly.


    Create a new JUnit Test Case named com.codeandme.tycho.plugin.ExampleViewTest.java with following content.
    package com.example.tycho.plugin;
    
    import static org.junit.Assert.*;
    
    import org.junit.Test;
    
    public class ExampleViewTest {
    
     @Test
     public void testID() {
      assertEquals("com.example.tycho.views.example", ExampleView.VIEW_ID);
     }
    }
    
    I admit, this is a very stupid test, but this tutorial is not about writing good unit tests, right?

    Step 2: Add test fragment to tycho build

    Once again convert your fragment project to a maven project. Set Packaging to eclipse-test-plugin and like before add the project to our master pom file.

    That's it! Build your product and your tests will automatically run as part of your build process. Try changing the assertion to provoke an error.

    The tycho surefire plugin works a bit differently compared to a JUnit Plug-in Test. Surefire will only load plugins that are referenced via dependencies by the test plugin. This means it will start the minimal set of bundles defined by the dependency tree. In contrary JUnit Plug-in Tests will load everything available in your workspace.

    Check the documentation to see how to add additional dependencies.

    Tycho build 6: Building products

    Now that we can build almost everything, there is just one step missing: building an RCP application.

    Tycho Tutorials

    For a list of all tycho related tutorials see Tycho Tutorials Overview

    Source code for this tutorial is available on github as a single zip archive, as a Team Project Set or you can browse the files online.

    Step 1: Convert required projects

    Our example product has additional dependencies to com.codeandme.tycho.product and com.codeandme.tycho.product.feature which are not part of our maven build yet. To build our product we need to convert them first.

    So convert com.codeandme.tycho.product to an eclipse-plugin and com.codeandme.tycho.product.feature to an eclipse-feature. Afterwards add both of them to our releng pom file. Nothing new so far.

    Verify that your build works before proceeding.

    Step 2: Create a project for our product

    Create a new General/Project called com.codeandme.tycho.releng.product. Convert it to a maven project with Packaging set to eclipse-repository. Add the new project to our releng pom file as a module like we did for all the other projects.

    Now move the file com.codeandme.tycho.product/Tycho.product to the root folder of our newly created project. Tycho will not pick up product files by default, so we need to adjust our com.codeandme.tycho.releng.product/pom.xml file a little. Add the following section within the project node:
     <build>
      <plugins>
       <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-p2-director-plugin</artifactId>
        <version>${tycho.version}</version>
        <executions>
         <execution>
          <!-- install the product using the p2 director -->
          <id>materialize-products</id>
          <goals>
           <goal>materialize-products</goal>
          </goals>
         </execution>
         <execution>
          <!-- create zip file with the installed product -->
          <id>archive-products</id>
          <goals>
           <goal>archive-products</goal>
          </goals>
         </execution>
        </executions>
       </plugin>
      </plugins>
     </build>

    Step 3: Set start levels of your product bundles

    There is one more step to take before we can run the build. It seems that PDE build (the thing that runs when you export an RCP product) adds some magic regarding bundle start levels. In fact it adjusts some autostart settings which we need to teach tycho manually.

    Open your product definition file and switch to the Configuration tab. Use the Add Recommended button to populate plug-ins with their according start levels.



    Save your product and start the build process. You should find your product in com.codeandme.tycho.releng.product/target/products/tycho.product/win32/win32/x86. There will also be a zipped version available in the target/products folder.

    If you have problems with the startup levels for your build, then use the Eclipse Product export wizard from the Overview tab of your product file. Switch to the folder where you exported your product to and open the file configuration/org.eclipse.equinox.simpleconfigurator/bundles.info. Each line holds an entry of type

    bundle_name,version,location,startlevel,autostart

    Find all bundles where autostart is set to true and add them in your product configuration file with their according start levels.

    Optional: Adding p2.inf files

    If you want to add additional p2 information to your product build, place your p2 file in the same folder as your project file and name it <project_name>.p2.inf.

    Eg. create a file com.codeandme.tycho.releng.product/Tycho.p2.inf with following content to add the Mars repository to the preconfigured update sites:

    instructions.configure=\
    org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:0,location:http${#58}//download.eclipse.org/releases/mars,name:Mars);\
    org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:1,location:http${#58}//download.eclipse.org/releases/mars,name:Mars);
    

    Optional: Build for multiple platforms

    Adding another platform is simple: just ad a new environment to your master pom file:
          <environment>
           <os>macosx</os>
           <ws>cocoa</ws>
           <arch>x86_64</arch>
          </environment>
    Eclipse help provides a full list of environment variables.

    Optional: Adding icons to your product

    When adding program icons in your product file the Browse... button will use an absolute path to your .ico file.


    Unfortunately the tycho build will not be able to pick up the image that way and report:
    Error - 7 icon(s) not replaced in <some path>\launcher.exe using
    <some other path>\com.example.tycho.releng.product\images\your_icon.ico
    To fix this use a path relative to your product definition file. For the example in the screenshot this would be images/my_product.ico.

    More information on icons is covered in this stacktrace topic.

    Tycho build 4: Building features

    For the following tycho tutorials I expect you to have set up a global build project. Now we are going to build a feature, which is really easy with tycho.

    Tycho Tutorials

    For a list of all tycho related tutorials see Tycho Tutorials Overview

    Source code for this tutorial is available on github as a single zip archive, as a Team Project Set or you can browse the files online.

    Step 1: Convert feature project to maven project

    The feature com.codeandme.tycho.plugin.feature already includes our plug-in com.codeandme.tycho.plugin. The only thing to do is convert the feature project to a maven project. Do this using the context menu Configure/Convert to Maven Project. I guess you are familiar with the procedure right now.

     Make sure you set Packaging to eclipse-feature.
    Now open the pom file of your releng project (com.codeandme.tycho.releng/pom.xml) and add our feature project as a new module. Don't forget to check Update POM parent section in selected projects.
    As before you will see an error marker on your feature project. To get rid of it switch to the Problems View, locate the error and use the quick fix feature to solve it.

    Run your build to verify your settings.




    Tycho build 2: Global maven settings

    In this tutorial we will look at some global maven settings to adjust how to access remote resources.

    Tycho Tutorials

    For a list of all tycho related tutorials see Tycho Tutorials Overview

    Maven Settings

    When maven is executed, it reads a global settings file which you should adapt to your needs. You can find its location in Preferences/Maven/User Settings. If you update the file you should either restart eclipse or click Update Settings on the preferences page.


    Setting a network proxy

    Maven needs network access. At least during the first runs it typically needs to download some catalogs. If you are located behind a proxy you might expect that maven honors your eclipse proxy settings. But as maven is an external tool, it does not honor your eclipse proxy settings. You have to enter them manually in the configuration file:

    <settings>
     .
     .
     <proxies>
      <proxy>
       <active>true</active>
       <protocol>http</protocol>
       <host>proxy.somewhere.com</host>
       <port>8080</port>
       <username>proxyuser</username>
       <password>somepassword</password>
       <nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts>
      </proxy>
     </proxies>
     .
     .
    </settings>

    As more and more sites change to https you might also need to add a separate proxy setting for https. For me it did not work out to provide something like http|https in the protocol section. Instead I added a second proxy node for the https protocol.

    I faced some problem accessing an NTLM proxy when using the embedded maven engine (you may set this in your run target). For me it worked to install an external maven version and use that for builds that need to access the internet over a proxy.

    Read the documentation for more details.

    Setting repository mirrors

    In the first tutorial we used the Juno download site to resolve our build dependencies. Maven allows to define mirrors for repositories which we can put in the global settings file:
    <settings>
     .
     .
     <mirrors>
      <mirror>
       <id>Mars_local</id>
       <mirrorOf>Mars</mirrorOf>
       <name>Local mirror of Mars repository</name>
       <url>file://C/some_folder/</url>
       <layout>p2</layout>
       <mirrorOfLayouts>p2</mirrorOfLayouts>
      </mirror>
     </mirrors>
     .
     .
    </settings> 

    The important parameter is mirrorOf. It contains the id of the original repository as defined in our pom file. As a consequence maven will favor our local mirror to resolve dependencies.Take care that your local repository is up to date as maven will not connect to the original repository anmore to resolve dependencies.

    When you share your poms with your team everybody will be able to build the project. Still you can use local mirrors for faster (or network independent) builds.

    Sunday, January 6, 2013

    Tycho build 5: Building p2 update sites

    Now that we can build plug-ins and features the next step will be to build an update site.

    Tycho Tutorials

    For a list of all tycho related tutorials see Tycho Tutorials Overview

    Source code for this tutorial is available on github as a single zip archive, as a Team Project Set or you can browse the files online.

    Step 1: Create an update site project

    Create a new project of type Plug-in Development/Update Site Project. Name it com.codeandme.tycho.releng.p2 and leave all the other settings to their defaults. You will end up in the Site Manifest Editor of your site.xml file. Add a New Category with some ID and a nice Name. Afterwards add the com.codeandme.tycho.plugin.feature to the category.



    Step 2: Convert to maven project

    Tycho expects the update site content to be stored in a file called category.xml. So rename site.xml to that name. You can still use the Site Manifest Editor to update your site contents afterwards.

    Now convert the p2 project to a maven project. The procedure is the same as before, only Packaging should be set to eclipse-repository.


    Switch to your com.codeandme.tycho.releng/pom.xml and add the com.codeandme.tycho.releng.p2 project as a module. Remember to check Update POM parent section in selected projects. Fix the build error as before and run your maven build.

    You can find your p2 update site in com.codeandme.tycho.releng.p2/target/repository. If you like you can immediately use this location to install your feature into your running eclipse instance.

    Tycho build 3: Creating a global build project

    During the first tycho tutorial we created a pom file to store our build instructions. Some of them will repeat for all the other things we will build later on. Therefore we will refactor our first project to extract common settings to a global pom file.

    Actually tycho already did something very similar for us. Open up com.codeandme.tycho.plugin/pom.xml and look at the Effective POM tab. Our pom file is augmented with a lot of additional settings. So pom files support a cascaded approach.

    Tycho Tutorials

    For a list of all tycho related tutorials see Tycho Tutorials Overview

    Source code for this tutorial is available on github as a single zip archive, as a Team Project Set or you can browse the files online.

    Step 1: Create a generic build project

    Create a new General/Project named com.codeandme.tycho.releng and convert it to a maven project (select Configure/Convert to Maven Project from the context menu). use the same Group ID as before, set the Version to 1.0.0-SNAPSHOT and the Packaging to pom. These steps will be pretty much the same for all the projects we will build with tycho.

    Step 2: Refactor pom files

    Move the properties, repositories and build section from our com.codeandme.tycho.plugin/pom.xml to the new one. (Remember the source code formatter works on xml files too). Of course our plug-in is unhappy now as information is missing in its pom file. Therefore we need to connect those poms somehow.

    Step 3: Adding modules to poms

    Open the Overview tab of com.codeandme.tycho.releng/pom.xml and Add... a Module. Select the com.codeandme.tycho.plugin.

    Do not forget to check Update POM parent section in selected projects! This will tell the module where to get its additional information from.


    After refactoring your poms should look like this:

    com.codeandme.tycho.releng/pom.xml
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <groupId>tycho_example</groupId>
     <artifactId>com.codeandme.tycho.releng</artifactId>
     <version>1.0.0-SNAPSHOT</version>
     <packaging>pom</packaging>
    
     <properties>
      <tycho.version>0.23.0</tycho.version>
    
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
    
     <repositories>
      <!-- add Mars repository to resolve dependencies -->
      <repository>
       <id>Mars</id>
       <layout>p2</layout>
       <url>http://download.eclipse.org/releases/mars/</url>
      </repository>
     </repositories>
    
     <build>
      <plugins>
       <plugin>
        <!-- enable tycho build extension -->
        <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>
        <version>${tycho.version}</version>
        <configuration>
         <environments>
          <environment>
           <os>win32</os>
           <ws>win32</ws>
           <arch>x86</arch>
          </environment>
         </environments>
        </configuration>
       </plugin>
      </plugins>
     </build>
     <modules>
      <module>../com.codeandme.tycho.plugin</module>
     </modules>
    </project>
    There is a new module section telling maven which modules to build when this project is built. As maven does not know anything about an eclipse workspace you cannot use variables like ${workspace_loc} here. Remember there will not be anything like a workspace when you trigger a build from command line anyway.

    com.codeandme.tycho.plugin/pom.xml
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <artifactId>com.codeandme.tycho.plugin</artifactId>
     <packaging>eclipse-plugin</packaging>
    
     <parent>
      <groupId>tycho_example</groupId>
      <artifactId>com.codeandme.tycho.releng</artifactId>
      <version>1.0.0-SNAPSHOT</version>
      <relativePath>../com.codeandme.tycho.releng</relativePath>
     </parent>
    </project>
    The parent section tells maven to integrate the parent pom when building this project.

    Now we can separate global settings from project specific ones and are ready to add additional projects to our build.

    Verify that your setup is correct by triggering a maven build on com.codeandme.tycho.releng. The goals are clean install. You can still build individual plug-ins by triggering a maven run on those projects.

    Step 4: Fix build warnings

    Our build log reveals two different warnings we have to fix.

    [WARNING] No explicit target runtime environment configuration. Build is platform dependent.
    ...
    [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
    
    First we configure an environment to build for. Open your master pom file and add the following code to the plugins section:
       <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>target-platform-configuration</artifactId>
        <version>${tycho.version}</version>
        <configuration>
         <environments>
          <environment>
           <os>win32</os>
           <ws>win32</ws>
           <arch>x86</arch>
          </environment>
         </environments>
        </configuration>
       </plugin>
    Of course this is only valid if you build for windows 32 bit. If you need to build for another platform you need to adjust os, ws and arch parameters accordingly. Remember that the build target does not depend on the platform you are developing on. I am writing this tutorial on a linux 64 bit machine and can still build for windows 32 bit.

    The second warning is even easier to fix. Add a property defining the source encoding:
     <properties>
      ...
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
    

    Tycho build 1: Building plug-ins

    Tycho is a great build tool for all your RCP build needs. It is a plug-in to maven and helps you to set up a reproducible build process which can be run interactively from your IDE or in headless mode (eg. on a build server).

    While there are already some tutorials out there (Mattias Holmqvist, Lars Vogel) how to integrate tycho, I could not find one that focuses on UI integration of maven. This article was heavily inspired by a great talk during EclipseCon by Jan Sievers and Tobias Oberlies.

    I will set this up as a series of posts. We will start by building a single plug-in and end up with a whole application built with tycho.

    During the tutorial I will use a plain installation of Eclipse for RCP and RAP Developers, Mars. No external programs are needed (so you don't need to install maven separately).

    Tycho Tutorials

    For a list of all tycho related tutorials see Tycho Tutorials Overview

    Source code for this tutorial is available on github as a single zip archive, as a Team Project Set or you can browse the files online.

    Preparations

    Before we start using tycho I created a short sample project consisting of a small eclipse-like product along with an additional feature. The latter contains one plug-in that provides a custom toolbar entry and an (almost empty) view.
     You can grab the initial sources from github as a single zip archive, as a Team Project Set or you can browse the files online. 

    Step 1: Install Tycho connector

    Eclipse for RCP and RAP Developers already comes with m2e, the maven integration tools of eclipse. Maven itself needs to be extended with tycho to allow to build plug-ins and other RCP like things.

    Go to Preferences/Maven/Discovery and click on Open Catalog. Find and select the Tycho Configurator.


    Install it and restart eclipse.

    Step 2: Build a simple plug-in project

    We will start by building com.codeandme.tycho.plugin. Right click on the project and select Configure/Convert to Maven Project.


    The wizard asks for a Group Id. Use a name that represents the component you want to build. Think of a component as a thing to assemble like my_product or JDT, PDE, ... you get the point. All projects that belong together will get the same Group Id.

    Leave the Artifact Id to the name of your project. Actually it should match the Bundle-SymbolicName found in MANIFEST.MF.

    Version should be set accordingly to Bundle-Version from the manifest. Later we will see how to keep those consistent. SNAPSHOT in maven is similar to qualifier in you plug-in version.

    Finally Packaging tells maven what type of build instructions to use. Set it to eclipse-plugin.

    Maven creates a pom.xml for you which we immediately replace with this one:

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <groupId>tycho_example</groupId>
     <artifactId>com.codeandme.tycho.plugin</artifactId>
     <version>1.0.0-SNAPSHOT</version>
     <packaging>eclipse-plugin</packaging>
    
     <properties>
      <tycho.version>0.23.0</tycho.version>
     </properties>
    
     <repositories>
      <!-- add Mars repository to resolve dependencies -->
      <repository>
       <id>Mars</id>
       <layout>p2</layout>
       <url>http://download.eclipse.org/releases/mars/</url>
      </repository>
     </repositories>
    
     <build>
      <plugins>
       <plugin>
        <!-- enable tycho build extension -->
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-maven-plugin</artifactId>
        <version>${tycho.version}</version>
        <extensions>true</extensions>
       </plugin>
      </plugins>
     </build>
    </project>
    Lines 9-11 add a property for the tycho version to be used. For future tycho versions you will need to upgrade this.
    Lines 13-20 add the Mars p2 repository for resolving dependencies during build time.
    The build section (lines 22-32) tells maven to use the tycho plug-in for the build process.

    Now you will see one error in your Problems View:


    We will face this error each time we convert a project to maven. To get rid of it select it in the Problems View and use the Quick Fix (from the context menu or by pressing Ctrl-1).You might face other error markers too, that indicate that some maven plugins cannot be found. They should valish after the first build, which will fetch all the requirements.

    Time to build our bundle: Right click on the project and select Run As/Maven build... Under Goals enter clean install. Goals are related to the maven lifecycle. See it as something similar to make targets if you are used to that. Basically we tell maven to delete previous build artifacts, to build our plug-in and to install build results.



    The first run will take some time as dependencies need to be downloaded from the Mars p2 site and from the maven central. At the end you should see something like this in your Console View:
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 18.128s
    [INFO] Finished at: 2015-07-30T14:11:20+02:00
    [INFO] Final Memory: 58M/139M
    [INFO] ------------------------------------------------------------------------
    

    Now check your project to find a new folder called target. It contains your build artifacts along with intermediate build files. Tycho will not refresh your workspace, so you have to do that manually to see the content of your target folder. If you want eclipse to do this automatically then open the run target you created before, switch to the Refresh tab and refresh The project containing the selected resource.

    Additionally tycho changed your .classpath file to write output to target/classes instead of the default bin folder.

    Congratulations, you've just built your first plug-in with tycho.

    Optional: Proxy support

    If you need to access the internet via a proxy, check out tutorial 2 first to see how to set the proxy server in maven.