Discussion:
Advice for multi-module builds, with SNAPSHOTs and Target Platforms.
(too old to reply)
Barrie Treloar
2012-07-06 06:18:52 UTC
Permalink
I'm down to my last two dependencies to get rid of hard coding in my
plugins classpath, build.properties and MANIFEST.MF.

But these are part of the current reactor build.
I'm not sure how to tell tycho where these artifacts are to be
included in the build process.
I also need them in my *.target file so Eclipse can also build the
target platform.

I can't find any examples of such setups.
The closest I can find is some of the Tycho ITs have multi-module
builds but they are all using non-SNAPSHOT version identifiers.

I'm trying to avoid the need to rebuild library files in order get the
latest changes in Eclipse.
Previously I had to make sure I ran maven to copy the latest libraries
into the lib directory of my plugin.
Developers could also "hack" their local plugin's classpath to depend
on the project already loaded into the Eclipse workspace instead of
using the jars on the filesystem.

I'm almost at the point where I just separate out the RCP stuff into
its own hierarchy and require non-SNAPSHOT builds to be used and
deployed to Nexus so that the *.target file can resolve dependencies
properly.
But that is going to cause some pain.

Does anyone have examples or advice on what I should do?
Igor Fedorenko
2012-07-06 11:32:59 UTC
Permalink
Everything is expected to just work if all projects are manifest-first
projects, i.e. use Tycho eclipse-* packaging types.

If some of the projects use maven-bundle-plugin to generate OSGi
bundles, these projects have to be built separate, before building
manifest-first projects. This is a known limitation documented in [1].
Everything is still expected to work inside m2e workspace, provided you
have m2e-tycho integration installed.


[1] http://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts

--
Regards,
Igor
Post by Barrie Treloar
I'm down to my last two dependencies to get rid of hard coding in my
plugins classpath, build.properties and MANIFEST.MF.
But these are part of the current reactor build.
I'm not sure how to tell tycho where these artifacts are to be
included in the build process.
I also need them in my *.target file so Eclipse can also build the
target platform.
I can't find any examples of such setups.
The closest I can find is some of the Tycho ITs have multi-module
builds but they are all using non-SNAPSHOT version identifiers.
I'm trying to avoid the need to rebuild library files in order get the
latest changes in Eclipse.
Previously I had to make sure I ran maven to copy the latest libraries
into the lib directory of my plugin.
Developers could also "hack" their local plugin's classpath to depend
on the project already loaded into the Eclipse workspace instead of
using the jars on the filesystem.
I'm almost at the point where I just separate out the RCP stuff into
its own hierarchy and require non-SNAPSHOT builds to be used and
deployed to Nexus so that the *.target file can resolve dependencies
properly.
But that is going to cause some pain.
Does anyone have examples or advice on what I should do?
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Barrie Treloar
2012-07-06 11:43:31 UTC
Permalink
Post by Igor Fedorenko
Everything is expected to just work if all projects are manifest-first
projects, i.e. use Tycho eclipse-* packaging types.
If some of the projects use maven-bundle-plugin to generate OSGi
bundles, these projects have to be built separate, before building
manifest-first projects. This is a known limitation documented in [1].
Everything is still expected to work inside m2e workspace, provided you
have m2e-tycho integration installed.
[1] http://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts
I'm definitely wanting Manifest first.

I'm not currently using m2e. But can you explain how m2e-tycho works its magic?
Does it extends the PDE runtime configuration so when I run my product
inside eclipse it can find the other eclipse-* packaging types?
What does the *.target file look like?
Is it fiddling with the classpath so that its using the workspace
versions instead of the target platform versions?
Igor Fedorenko
2012-07-06 12:07:19 UTC
Permalink
It's really hard to tell anything specific without a small example that
demonstrates the problem.

Generally though, PDE is expected to resolve cross-project dependencies
inside workspace projects regardless of workspace target platform
configuraion. Likewise, Tycho is expected to resolve dependencies among
reactor projects regardless of build target platform configuration.

--
Regards,
Igor
Post by Barrie Treloar
Post by Igor Fedorenko
Everything is expected to just work if all projects are manifest-first
projects, i.e. use Tycho eclipse-* packaging types.
If some of the projects use maven-bundle-plugin to generate OSGi
bundles, these projects have to be built separate, before building
manifest-first projects. This is a known limitation documented in [1].
Everything is still expected to work inside m2e workspace, provided you
have m2e-tycho integration installed.
[1] http://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts
I'm definitely wanting Manifest first.
I'm not currently using m2e. But can you explain how m2e-tycho works its magic?
Does it extends the PDE runtime configuration so when I run my product
inside eclipse it can find the other eclipse-* packaging types?
What does the *.target file look like?
Is it fiddling with the classpath so that its using the workspace
versions instead of the target platform versions?
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Barrie Treloar
2012-07-06 13:21:13 UTC
Permalink
Post by Igor Fedorenko
It's really hard to tell anything specific without a small example that
demonstrates the problem.
Generally though, PDE is expected to resolve cross-project dependencies
inside workspace projects regardless of workspace target platform
configuraion. Likewise, Tycho is expected to resolve dependencies among
reactor projects regardless of build target platform configuration.
Ahh that's good to know.
I will give it a go.
There isn't really a problem, except I dont know what I am doing and
therefore making incorrect assumptions.
Still trying to work out what I should be doing.
Barrie Treloar
2012-07-11 08:05:12 UTC
Permalink
Ok, Almost there...

Got pom-first happening for those artifacts the client depends upon
that we create.
Tycho builds my product and it runs, YAY and there was much rejoicing.

I have now got m2e installed and all my projects have no m2e errors.
But, if I try to run my product inside Eclipse it fails because it
can't find the packages for those pom-first bundles.

If I check the Java Build Path they look like folders in the Libraries tab.

Is it possible to run my product in Eclipse now that it is Tycho'fied?
Any clues on what I have forgotten to do?

Thanks
Igor Fedorenko
2012-07-11 11:01:25 UTC
Permalink
Do you have m2e-tycho installed? Run-As Eclipse Application and Plugin
Junit test are expected to work, but plain java applications are not.

--
Regards,
Igor
Post by Barrie Treloar
Ok, Almost there...
Got pom-first happening for those artifacts the client depends upon
that we create.
Tycho builds my product and it runs, YAY and there was much rejoicing.
I have now got m2e installed and all my projects have no m2e errors.
But, if I try to run my product inside Eclipse it fails because it
can't find the packages for those pom-first bundles.
If I check the Java Build Path they look like folders in the Libraries tab.
Is it possible to run my product in Eclipse now that it is Tycho'fied?
Any clues on what I have forgotten to do?
Thanks
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Barrie Treloar
2012-07-11 12:12:17 UTC
Permalink
Post by Igor Fedorenko
Do you have m2e-tycho installed? Run-As Eclipse Application and Plugin
Junit test are expected to work, but plain java applications are not.
Probably not, how would I tell?
Google isn't giving me the instlal m2e-tycho instructions on the first
page of hits.

Its an RCP application so I am expecting that once I have m2e-tycho
installed it should work.
Barrie Treloar
2012-07-16 01:46:37 UTC
Permalink
Post by Barrie Treloar
Post by Igor Fedorenko
Do you have m2e-tycho installed? Run-As Eclipse Application and Plugin
Junit test are expected to work, but plain java applications are not.
Probably not, how would I tell?
Google isn't giving me the instlal m2e-tycho instructions on the first
page of hits.
Its an RCP application so I am expecting that once I have m2e-tycho
installed it should work.
I have m2e 1.1.0.20120530-0009 installed and the Plug-in Details
doesn't show anything Tycho related.

I can't find anything on the wiki at
http://wiki.eclipse.org/Category:M2E about Tycho and m2e either.
Igor Fedorenko
2012-07-16 08:31:54 UTC
Permalink
Like I said, RunAs Eclipse Application is expected to work without any
special configuration, so there is nothing to document. Please provide
small standalone example project that highlights your problem and I'll
see if I can help.

--
Regards,
Igor
Post by Barrie Treloar
Post by Barrie Treloar
Post by Igor Fedorenko
Do you have m2e-tycho installed? Run-As Eclipse Application and Plugin
Junit test are expected to work, but plain java applications are not.
Probably not, how would I tell?
Google isn't giving me the instlal m2e-tycho instructions on the first
page of hits.
Its an RCP application so I am expecting that once I have m2e-tycho
installed it should work.
I have m2e 1.1.0.20120530-0009 installed and the Plug-in Details
doesn't show anything Tycho related.
I can't find anything on the wiki at
http://wiki.eclipse.org/Category:M2E about Tycho and m2e either.
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Barrie Treloar
2012-07-16 10:26:21 UTC
Permalink
Post by Igor Fedorenko
Like I said, RunAs Eclipse Application is expected to work without any
special configuration, so there is nothing to document. Please provide
small standalone example project that highlights your problem and I'll
see if I can help.
Fair enough.
I was confused about needing m2e tycho.
Barrie Treloar
2012-07-18 02:10:19 UTC
Permalink
Post by Barrie Treloar
Post by Igor Fedorenko
Like I said, RunAs Eclipse Application is expected to work without any
special configuration, so there is nothing to document. Please provide
small standalone example project that highlights your problem and I'll
see if I can help.
Fair enough.
I was confused about needing m2e tycho.
I've managed to get it to work.
You are right that I don't need to do anything magical.

My problem was probably introducing too much change, instead of
smaller steps. Each step takes so long I thought I could cut some
corners...
I had everything working except for the pom-first.
After getting the current modules working as pom-first and splitting
the build into two, I went back to do the same thing to the other
internal (but not same project) dependency.

I think I also migrated from Require-Bundle to Import-Package at the same time.
I'm sure I double checked my Import-Package statements but it turns
out I was missing one package, so when I was getting errors I thought
it was because the pom-first stuff wasn't working, or some other issue
to do with class loading and log4j, xstream, spring...

And while I mention changing too much stuff, as part of attempting to
fix this issue I re-wrapped my non-OSGi dependencies and changed the
Eclipse-BuddyPolicy from "registered" to 'dependent".
Which didn't fix my problems (as I thought, since it was missing
Import-Packages), but has fixed my need to copy in
META-INF/spring.handlers and META-INF/spring.schemas from the spring
bundles.

Thank you very much for your patience and answers.

Continue reading on narkive:
Loading...