Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Optional plugins in feature

Hi Igor,

Thanks for taking the time to reply. Please see inline:


On Fri, Sep 27, 2013 at 6:49 PM, Igor Fedorenko <igor@xxxxxxxxxxxxxx> wrote:
This is not possible and likely will never be possible. Tycho treats
OSGi/Eclipse project metadata files the same way Maven treats pom.xml
file. Maven does not allow dynamic changes to pom.xml files. Tycho does
not allow dynamic changes to bundle manifest, feature.xml and other
OSGi/Eclipse metadata files.

I can do what I need using profiles, so in its own way, Maven allows some configurability. 
 
As for dependencies on pom-first projects, it is not currently possible
to combine pom-first and manifest-first modules in the same reactor
build. I think I know how implement this, but this is a lot of work and
not something I plan to do any time soon. For now you must build
pom-first modules first. Then build manifest-first modules. See Tycho
wiki [1]

I know that page too well :) I don't think it's the problem here, as I *do* have the required bundles installed in my local maven repository.

What I find surprising is that Tycho *does* complain it cannot find a plugin (one that is specified *only* in the file that I copy, so at phase "initialize"). The surprise comes from the tact that it *takes* it into account, but it doesn't find it (although I enabled pomConsider, and the bundle is a pom dependency of my build, confirmed in logs). If I run the build a second time (so copy is a no-op, since the file is already in place), it succeeds. So, I think that Tycho reads features.xml *two* times, leading to the inconsistent answer.

Would you have another suggestion on how to achieve this, one that is more in line with Eclipse and Tycho? Essentially, all I want to do is to add (or not) a certain plugin in my feature.

thanks,
iulian
 

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

--
Regards,
Igor


On 2013-09-27 12:04 PM, iulian dragos wrote:
Hi,

I am trying to optionally include a plugin in my feature, based on a
Maven profile. I can't seem to get it to work.

Here's what I tried: inside my feature project, I added a resources
directory with two versions:

.../feature/
   resources/
      feature-1.xml
      feature-2.xml
   feature.xml

I need to have a feature.xml, otherwise Tycho will complain. In the
'initialize' phase of the feature project, I copy the correct feature
file and overwrite `feature.xml`. This works fine, but the build fails with:

package-feature failed: Could not resolve plugin
org.scala-lang.modules.scala-xml_0.0.0; Path to dependency: -> [Help 1]

This is one of the optional plugins, so:

1. copy worked
2. it is being considered for inclusion
3. .. but Tycho still can't find it.

The required bundle (it's a pom-first) appears in my dependencies. If I
run it a second time (this time `feature.xml` is already in place, with
the additional plugin entries), the build succeeds. It looks like Tycho
looks at features.xml very early on, and ignores plugins that are not
specified in there?

Is there a way to make this work? Alternatives? I'd like to have a
single build step (I know I could do the copy in a maven run).

It looks like Eclipse specific files (MANIFEST, features.xml, etc.)
can't be configured the "maven" way, since they are considered so early
in the lifecycle. Is there a better "Tycho way"?

thanks,
iulian

--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais


_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user



--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais

Back to the top