Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Maven Integration (M2E) » Using tycho to build target platform
Using tycho to build target platform [message #25440] Thu, 07 May 2009 19:34 Go to next message
Will Horn is currently offline Will HornFriend
Messages: 265
Registered: July 2009
Senior Member
Using the felix maven-bundle-plugin I am able to instruct maven to build a
target platform that contains all the necessary third party dependencies.
In case anyone is interested, I included the steps/poms below [1].

It is not a particularly elegant solution and I hope to improve it. I
noticed this recent blog entry:
http://www.sonatype.com/people/2009/04/tycho-implicit-build- target-platform-support-from-maven/

I'm wondering if it solves the problem I have. I would like to list a set
of artifacts that include OSGi bundles in maven repositories and Eclipse
plugins in p2 repositories, and have tycho compute the transitive
dependencies and build an Eclipse target platform.

Is this possible? Or any suggestions on how to attack it?

One more thing: from the blog demo, I see that Tycho is actually computing
the target platform from the "Require-Bundle" headers in the MANIFEST.MF.
That is cool, but is it intended to work with "Import-Package"? I tried and
had some trouble. I assume Tycho needs the bundle symbolic name, which is
understandable. That just means that I need to use the list approach above
instead of just pointing to a set a plugins and having the target platform
completely inferred.

Thanks,
Will

[1]
1)build a massive OSGi bundle that contains the transitive dependencies of
the libraries I want to be available in my target
( http://code.marketcetera.org/root/trunk/source/photon/maven/ bundle/pom.xml).
2)use the maven-dependency-plugin to copy all the eclipse plugins and the
bundle from the first step into a target platform
( http://code.marketcetera.org/root/trunk/source/photon/maven/ rcptarget/pom.xml).
Re: Using tycho to build target platform [message #25562 is a reply to message #25440] Fri, 08 May 2009 00:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: igor.ifedorenko.com

I see few separate issues here.

Our plan for Tycho 0.4.0 is to allow build target platform resolution to
use both Maven and P2 repositories. Tycho 0.4.0-DEV-2233 is the first
build to support P2 repositories and we plan to add ability to mix
MAven2 and P2 repositories in the next DEV build (I will be providing
more details at that time). You can read more about features planned for
0.4.0 in [1]. We are very interested in user feedback, so feel free to
send your comments either here or to tycho-users mailing list.

Tycho 0.4.0 is supposed to take Import-Package declarations into account
when resolving build target platform in "p2" mode. Please create new
bugreport in JIRA [2] and provide sample project we can use to reproduce
the problem.

Tycho is not able to use "plain" JAR files from Maven repositories
directly because Maven artifacts do not contain enough metadata to
reliably construct OSGi bundles from them. We are considering several
ways to improve this, but for now you need to "bundalize" Maven
artifacts first. You can use Felix/BND plugin or you can use Tycho
generate-bundle to do this (and there is a good chance we will merge the
two in some time in the future).


[1] http://docs.codehaus.org/display/M2ECLIPSE/Tycho+0.4.0+plan
[2] https://issues.sonatype.org/browse/MNGECLIPSE

--
Regards,
Igor



Will Horn wrote:
> Using the felix maven-bundle-plugin I am able to instruct maven to build
> a target platform that contains all the necessary third party
> dependencies. In case anyone is interested, I included the steps/poms
> below [1].
>
> It is not a particularly elegant solution and I hope to improve it. I
> noticed this recent blog entry:
> http://www.sonatype.com/people/2009/04/tycho-implicit-build- target-platform-support-from-maven/
>
>
> I'm wondering if it solves the problem I have. I would like to list a
> set of artifacts that include OSGi bundles in maven repositories and
> Eclipse plugins in p2 repositories, and have tycho compute the
> transitive dependencies and build an Eclipse target platform.
>
> Is this possible? Or any suggestions on how to attack it?
>
> One more thing: from the blog demo, I see that Tycho is actually
> computing the target platform from the "Require-Bundle" headers in the
> MANIFEST.MF. That is cool, but is it intended to work with
> "Import-Package"? I tried and had some trouble. I assume Tycho needs
> the bundle symbolic name, which is understandable. That just means that
> I need to use the list approach above instead of just pointing to a set
> a plugins and having the target platform completely inferred.
>
> Thanks,
> Will
>
> [1]
> 1)build a massive OSGi bundle that contains the transitive dependencies
> of the libraries I want to be available in my target
> ( http://code.marketcetera.org/root/trunk/source/photon/maven/ bundle/pom.xml).
>
> 2)use the maven-dependency-plugin to copy all the eclipse plugins and
> the bundle from the first step into a target platform
> ( http://code.marketcetera.org/root/trunk/source/photon/maven/ rcptarget/pom.xml).
>
Re: Using tycho to build target platform [message #25602 is a reply to message #25562] Fri, 08 May 2009 01:04 Go to previous messageGo to next message
Will Horn is currently offline Will HornFriend
Messages: 265
Registered: July 2009
Senior Member
> Tycho 0.4.0 is supposed to take Import-Package declarations into account
> when resolving build target platform in "p2" mode. Please create new
> bugreport in JIRA [2] and provide sample project we can use to reproduce
> the problem.
This was my fault, I had accidentally specified a version on the
import-package which applied to Eclipse 3.5, forgetting the tycho build was
against an Eclipse 3.4 p2 repository.

> Tycho is not able to use "plain" JAR files from Maven repositories
> directly because Maven artifacts do not contain enough metadata to
> reliably construct OSGi bundles from them. We are considering several ways
> to improve this, but for now you need to "bundalize" Maven artifacts
> first. You can use Felix/BND plugin or you can use Tycho generate-bundle
> to do this (and there is a good chance we will merge the two in some time
> in the future).
I understand this. But if my maven artifacts are already fully bundalized,
how do I get them into the target platform? I really like the implicit TP
feature, but what I would like to do at this point is just specify a TP
explicitly and have tycho create it, i.e. build a directory that I can use
in the Eclipse IDE and in a tycho build via "-Dtycho.targetPlatform=...".
[1] has a section entitled "TP specification artifact" that seems to address
this topic somewhat.

I notice m2eclipse uses a shell script to do a similar thing
(http://svn.sonatype.org/m2eclipse/tycho/trunk/tp-scripts/m2 e-e34.sh) but
I'm trying to automate that. Is this possible?

Thanks,
Will

> [1] http://docs.codehaus.org/display/M2ECLIPSE/Tycho+0.4.0+plan
Re: Using tycho to build target platform [message #25640 is a reply to message #25602] Fri, 08 May 2009 02:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: igor.ifedorenko.com

At this moment we do not plan to support target platform materialization
in Tycho. However, this should be next to trivial to implement (maybe 50
lines of code), so if you are interested I can provide pointers to help
you start.

Aslo, do you know that you can define build target platform using
<dependencyManagement/> pom.xml element and Tycho will use configured
Maven2 repositories to source these dependencies?

Also, we plan to add build target platform management to Sonatype Studio
(commercial M2E derivative). From user standpoint it will work similar
to how M2E manages content of Maven Dependencies classpath container,
where dependencies are added/removed according to changes to pom.xml
file automatically.

--
Regards,
Igor


Will Horn wrote:
>> Tycho 0.4.0 is supposed to take Import-Package declarations into
>> account when resolving build target platform in "p2" mode. Please
>> create new bugreport in JIRA [2] and provide sample project we can use
>> to reproduce the problem.
> This was my fault, I had accidentally specified a version on the
> import-package which applied to Eclipse 3.5, forgetting the tycho build
> was against an Eclipse 3.4 p2 repository.
>
>> Tycho is not able to use "plain" JAR files from Maven repositories
>> directly because Maven artifacts do not contain enough metadata to
>> reliably construct OSGi bundles from them. We are considering several
>> ways to improve this, but for now you need to "bundalize" Maven
>> artifacts first. You can use Felix/BND plugin or you can use Tycho
>> generate-bundle to do this (and there is a good chance we will merge
>> the two in some time in the future).
> I understand this. But if my maven artifacts are already fully
> bundalized, how do I get them into the target platform? I really like
> the implicit TP feature, but what I would like to do at this point is
> just specify a TP explicitly and have tycho create it, i.e. build a
> directory that I can use in the Eclipse IDE and in a tycho build via
> "-Dtycho.targetPlatform=...". [1] has a section entitled "TP
> specification artifact" that seems to address this topic somewhat.
>
> I notice m2eclipse uses a shell script to do a similar thing
> (http://svn.sonatype.org/m2eclipse/tycho/trunk/tp-scripts/m2 e-e34.sh)
> but I'm trying to automate that. Is this possible?
>
> Thanks,
> Will
>
>> [1] http://docs.codehaus.org/display/M2ECLIPSE/Tycho+0.4.0+plan
>
Re: Using tycho to build target platform [message #25672 is a reply to message #25640] Fri, 08 May 2009 16:00 Go to previous messageGo to next message
Will Horn is currently offline Will HornFriend
Messages: 265
Registered: July 2009
Senior Member
"Igor Fedorenko" <igor@ifedorenko.com> wrote in message
news:gu05jf$lfs$1@build.eclipse.org...
> At this moment we do not plan to support target platform materialization
> in Tycho. However, this should be next to trivial to implement (maybe 50
> lines of code), so if you are interested I can provide pointers to help
> you start.
I am interested. Curently I am using the maven-dependency-plugin. The
copy-dependency goal works for bundalized maven artifact dependencies. For
the eclipse components, I don't use dependencyManagement, but just upload
the distribution zips (like the SDK and delta pack) to our own maven repo
and use the unpack goal. I'd like to avoid this second piece (manually
uploading eclipse zips and maintaining a full list of plugins) and take
advantage of tycho's understanding of public p2 repos and transative osgi
dependencies.

> Aslo, do you know that you can define build target platform using
> <dependencyManagement/> pom.xml element and Tycho will use configured
> Maven2 repositories to source these dependencies?
My bundalized maven artifacts are in "dependencyManagement". But how do I
specify a p2 dependency, like org.eclipse.ui? I tried using a groupId of
p2:
<dependency>
<groupId>p2</groupId>
<artifactId>org.eclipse.ui</artifactId>
<version>3.4.2.M20090204-0800</version>
</dependency>

> Also, we plan to add build target platform management to Sonatype Studio
> (commercial M2E derivative). From user standpoint it will work similar to
> how M2E manages content of Maven Dependencies classpath container, where
> dependencies are added/removed according to changes to pom.xml file
> automatically.
Sounds like a great feature, especially in conjunction with nexus pro's p2
proxying. My product is open source so we try to have no dependencies on
paid commercial products for the development environment. But I will keep
it in mind.

Thanks,
Will
Re: Using tycho to build target platform [message #25702 is a reply to message #25672] Fri, 08 May 2009 17:46 Go to previous message
Eclipse UserFriend
Originally posted by: igor.ifedorenko.com

I don't have use of dependencyManagement by Tycho documented anywhere
yet. The best I can offer is Tycho integration test of this
functionality [1]. build01 installs a number of artifacts to maven local
repo. build02 uses dependencyManagement to add these artifacts to build
target platform.

Tycho development environment setup is explained in [2]. Steps to build
tycho from CLI are explained in [3].

To materialize target platform, you will need to grab TargetPlatform
associated with a project and then copy bundles/features from the target
platform to the destination folder. There are currently couple of places
that perform similar logic (product export and test runtime creation).
If you can consolidate this logic in one place this will be much
appreciated ;-)

Let me know if you have any questions.

--
Regards,
Igor


[1]
https://svn.sonatype.org/m2eclipse/tycho/trunk/tycho-its/pro jects/tycho164
[2] http://docs.codehaus.org/display/M2ECLIPSE/Tycho+development +environment
[3] http://docs.codehaus.org/display/M2ECLIPSE/Building+tycho



Will Horn wrote:
> "Igor Fedorenko" <igor@ifedorenko.com> wrote in message
> news:gu05jf$lfs$1@build.eclipse.org...
>> At this moment we do not plan to support target platform
>> materialization in Tycho. However, this should be next to trivial to
>> implement (maybe 50 lines of code), so if you are interested I can
>> provide pointers to help you start.
> I am interested. Curently I am using the maven-dependency-plugin. The
> copy-dependency goal works for bundalized maven artifact dependencies.
> For the eclipse components, I don't use dependencyManagement, but just
> upload the distribution zips (like the SDK and delta pack) to our own
> maven repo and use the unpack goal. I'd like to avoid this second piece
> (manually uploading eclipse zips and maintaining a full list of plugins)
> and take advantage of tycho's understanding of public p2 repos and
> transative osgi dependencies.
>
>> Aslo, do you know that you can define build target platform using
>> <dependencyManagement/> pom.xml element and Tycho will use configured
>> Maven2 repositories to source these dependencies?
> My bundalized maven artifacts are in "dependencyManagement". But how do
> I specify a p2 dependency, like org.eclipse.ui? I tried using a groupId
> of p2:
> <dependency>
> <groupId>p2</groupId>
> <artifactId>org.eclipse.ui</artifactId>
> <version>3.4.2.M20090204-0800</version>
> </dependency>
>
>> Also, we plan to add build target platform management to Sonatype
>> Studio (commercial M2E derivative). From user standpoint it will work
>> similar to how M2E manages content of Maven Dependencies classpath
>> container, where dependencies are added/removed according to changes
>> to pom.xml file automatically.
> Sounds like a great feature, especially in conjunction with nexus pro's
> p2 proxying. My product is open source so we try to have no
> dependencies on paid commercial products for the development
> environment. But I will keep it in mind.
>
> Thanks,
> Will
Previous Topic:[tycho] best way of using multiple maven versions in parallel
Next Topic:Re: [m2eclipse-user] Tycho: Eclipse plugin dependency resolution from local repository
Goto Forum:
  


Current Time: Wed Apr 24 13:34:02 GMT 2024

Powered by FUDForum. Page generated in 0.03726 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top