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

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.

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]

[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



Back to the top