Discussion:
[tycho-user] My first Tycho build
Adolfo Sánchez-Barbudo Herrera
2017-01-17 13:25:47 UTC
Permalink
Hi Folks,

I'm trying to create a tycho-based build for the Eclipse OCL project [1].
We are currently using buckminster.

For the time being, my first attempts try to build the project P2
repository using typical tycho configuration file [2] with "clean verify"
goals. So far, I've got a few probably-naive questions for you, so please
bear with me:

------
The first problem I got was that few plugins and features have the same
identifier: bundle symbolic name and feature name respectively. If
additionally they have the same version, the tycho/maven-based build fails.
Is there any way to avoid the issue, apart from the obvious workaround of
making either the name or the version differ ?

-----
The second problem I've found is the automatic generation of sources for
features. Looking at the current Eclipse OCL features, some of them include
source features, others donÂŽt. For instance, org.eclipse.ocl.all [3] does
not include source features. The build is currently failing with the
following error:

[ERROR] Failed to execute goal
org.eclipse.tycho.extras:tycho-source-feature-plugin:0.26.0:source-feature
(source-feature) on project org.eclipse.ocl.all: Could not generate source
feature for project MavenProject:
org.eclipse.ocl:org.eclipse.ocl.all:5.2.200-SNAPSHOT @
XXXXXXX\features\org.eclipse.ocl.all-feature\.polyglot.build.properties
[ERROR] Missing sources for features [org.eclipse.ocl_3.6.201.201701171307,
org.eclipse.ocl.uml_5.2.201.201701171307]

If I try to exclude the source feature generation for that particular
feature in the main configuration pom file [2] (lines 62-66), I still get
the same failure. Any suggestion/tip/documentation link about how to deal
with source features ?

----

A third problem I foresee, related to testing (I've not tried tests
execution yet). With buckminter there is the concept of workspace and
workspace provision. Is there anything similar in tycho/maven ? IIRC, OCL
tests cases require that some third party projects exist in the workspace,
and I'm unclear whether the tests cases are gonna work without them.

Any suggestion/tip about this need ?

----

Our current buckminster-based build currently uses some ant-based tasks to
perform some activities. I still need to investigate which ones can be
replaced by tycho, but can ant-tasks be invoked during the tycho/maven
build ? Any useful documentation pointer to this concern ?

Cheers,
Adolfo.

[1] http://git.eclipse.org/c/ocl/org.eclipse.ocl.git/log/?h=asanchez/tycho
[2]
http://git.eclipse.org/c/ocl/org.eclipse.ocl.git/tree/releng/org.eclipse.ocl.releng.tycho/pom.xml?h=asanchez/tycho
[3]
http://git.eclipse.org/c/ocl/org.eclipse.ocl.git/tree/features/org.eclipse.ocl.all-feature/feature.xml?h=asanchez/tycho
Sievers, Jan
2017-01-18 08:40:43 UTC
Permalink
Post by Adolfo Sánchez-Barbudo Herrera
------
The first problem I got was that few plugins and features have the same identifier: bundle symbolic name and feature name respectively. If
additionally they have the same version, the tycho/maven-based build fails. Is there any way to avoid the issue,
apart from the obvious workaround of making either the name or the version differ ?
have you tried using different maven groupIds for plugins and features?
Post by Adolfo Sánchez-Barbudo Herrera
-----
The second problem I've found is the automatic generation of sources for features. Looking at the current Eclipse OCL features, some of them
include source features, others don´t. For instance, org.eclipse.ocl.all [3] does not include source features.
[ERROR] Failed to execute goal org.eclipse.tycho.extras:tycho-source-feature-plugin:0.26.0:source-feature (source-feature) on project
org.eclipse.ocl.all: Could not generate source feature for project MavenProject: org.eclipse.ocl:org.eclipse.ocl.all:5.2.200-SNAPSHOT
@ XXXXXXX\features\org.eclipse.ocl.all-feature\.polyglot.build.properties
[ERROR] Missing sources for features [org.eclipse.ocl_3.6.201.201701171307, org.eclipse.ocl.uml_5.2.201.201701171307]
If I try to exclude the source feature generation for that particular feature in the main configuration pom file [2] (lines 62-66), I still
get the same failure. Any suggestion/tip/documentation link about how to deal with source features ?
I think you should exclude

<configuration>
<excludes>
<feature id="org.eclipse.ocl" />
<feature id="org.eclipse.ocl.uml" />
</excludes>
</configuration>


see https://eclipse.org/tycho/sitedocs-extras/tycho-source-feature-plugin/source-feature-mojo.html
and https://wiki.eclipse.org/Tycho/Reference_Card#Source_Features
Post by Adolfo Sánchez-Barbudo Herrera
A third problem I foresee, related to testing (I've not tried tests execution yet). With buckminter there is the concept of workspace and
workspace provision. Is there anything similar in tycho/maven ? IIRC, OCL tests cases require that some third party
projects exist in the workspace, and I'm unclear whether the tests cases are gonna work without them.
the eclipse workspace for JUnit tests is empty by default.
You may be able to copy/extract files to
https://eclipse.org/tycho/sitedocs/tycho-surefire/tycho-surefire-plugin/test-mojo.html#osgiDataDirectory

during build prior to test execution or configure it to use a workspace folder not located in target/.

Note that the workspace folder keeps state so it's probably a good idea to keep it in target/ so it's cleaned on mvn clean and copy files each time before test execution.

Regards,
Jan
LE FEVRE FRANCOIS
2017-01-19 08:51:54 UTC
Permalink
Hey
I do not know if it will be usefull for you but perhaps it could help you or others.

We have created a maven archetype to create a tycho compliant project for our project in Eclipse Papyrus.
We have choosen several conventions that you could obvsiouly changed to match your own requirements.

Prerequisites is to be in a folder manage by a git repository, and have the papyrus repositories define in your maven settings
You could look at [1]

You could just execute the following command
mvn archetype:generate -DarchetypeGroupId=org.eclipse.papyrus.components -DarchetypeArtifactId=org.eclipse.papyrus.components.archetype -DarchetypeRepository=https://repo.eclipse.org/content/repositories/papyrus-releases/ -DarchetypeVersion=0.0.18-SNAPSHOT -DgroupId=com.cea.PROJECTCATEGORY -DartifactId=com.cea.PROJECTCATEGORY.PROJECT -Dversion=0.0.1 -DfullartifactId=com.cea.PROJECTCATEGORY.PROJECT -DcomponentName=com.cea.PROJECTCATEGORY-PROJECT -DhudsonViewName=HUDSON_TAB -DbugzillaName=BUGZILLA_COMPONENT

Then you should be able to run a default
mvn clean install -Dtycho.localArtifacts=ignore
or
mvn clean install -Pproduct

It will create for your p2/updatesite and also the rcp etc...
It will also be able to generate a default web site such the one describe in [1,2]

Then you have to migrate your plugins of interest in it, changing the pom to add the modules you added and update the feature .

I thing this archetype could be upgraded to be more generic, this could be a good idea for Eclipse Tycho community.
All code is open source/epl and manage here [2]

Have fun.

Francois

[1]: https://hudson.eclipse.org/papyrus/view/Components/job/papyrus-components-website/ws/site-staging/org.eclipse.papyrus.components.archetype/user/sop-projectcreation.html
[2]: https://hudson.eclipse.org/papyrus/view/Components/job/papyrus-components-website/ws/site-staging//source-repository.html


-----Message d'origine-----
De : tycho-user-***@eclipse.org [mailto:tycho-user-***@eclipse.org] De la part de Sievers, Jan
Envoyé : mercredi 18 janvier 2017 09:41
À : Tycho user list <tycho-***@eclipse.org>
Objet : Re: [tycho-user] My first Tycho build
Post by Adolfo Sánchez-Barbudo Herrera
------
The first problem I got was that few plugins and features have the same
identifier: bundle symbolic name and feature name respectively. If
additionally they have the same version, the tycho/maven-based build fails. Is there any way to avoid the issue, apart from the obvious workaround of making either the name or the version differ ?
have you tried using different maven groupIds for plugins and features?
Post by Adolfo Sánchez-Barbudo Herrera
-----
The second problem I've found is the automatic generation of sources
for features. Looking at the current Eclipse OCL features, some of them include source features, others don´t. For instance, org.eclipse.ocl.all [3] does not include source features.
[ERROR] Failed to execute goal
org.eclipse.tycho.extras:tycho-source-feature-plugin:0.26.0:source-feat
ure (source-feature) on project
org.eclipse.ocl.all: Could not generate source feature for project
MavenProject: org.eclipse.ocl:org.eclipse.ocl.all:5.2.200-SNAPSHOT
@
XXXXXXX\features\org.eclipse.ocl.all-feature\.polyglot.build.properties
[ERROR] Missing sources for features
[org.eclipse.ocl_3.6.201.201701171307,
org.eclipse.ocl.uml_5.2.201.201701171307]
If I try to exclude the source feature generation for that particular
feature in the main configuration pom file [2] (lines 62-66), I still get the same failure. Any suggestion/tip/documentation link about how to deal with source features ?
I think you should exclude

<configuration>
<excludes>
<feature id="org.eclipse.ocl" />
<feature id="org.eclipse.ocl.uml" />
</excludes>
</configuration>


see https://eclipse.org/tycho/sitedocs-extras/tycho-source-feature-plugin/source-feature-mojo.html
and https://wiki.eclipse.org/Tycho/Reference_Card#Source_Features
Post by Adolfo Sánchez-Barbudo Herrera
A third problem I foresee, related to testing (I've not tried tests
execution yet). With buckminter there is the concept of workspace and
workspace provision. Is there anything similar in tycho/maven ? IIRC, OCL tests cases require that some third party projects exist in the workspace, and I'm unclear whether the tests cases are gonna work without them.
the eclipse workspace for JUnit tests is empty by default.
You may be able to copy/extract files to https://eclipse.org/tycho/sitedocs/tycho-surefire/tycho-surefire-plugin/test-mojo.html#osgiDataDirectory

during build prior to test execution or configure it to use a workspace folder not located in target/.

Note that the workspace folder keeps state so it's probably a good idea to keep it in target/ so it's cleaned on mvn clean and copy files each time before test execution.

Regards,
Jan


_______________________________________________
tycho-user mailing list
tycho-***@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/tycho-user
Loading...