Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Selective Compiling, is this possible?

Although not documented, it is possible to add extra constraints to help
Tycho dependency resolver choose from alternative providers of the same
capability. Try adding configuration like below to BundleC pom.xml file


      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>target-platform-configuration</artifactId>
        <version>${tycho-version}</version>
        <configuration>
          <dependency-resolution>
            <extraRequirements>
              <requirement>
                <type>eclipse-plugin</type>
                <id>BundleB</id>
                <versionRange>0.0.0</versionRange>
              </requirement>
            </extraRequirements>
          </dependency-resolution>
        </configuration>
      </plugin>

This will tell Tycho to resolve BundleC dependencies as if it had
"Require-Bundle: BundleB" in addition to existing Import-Package, which
will give BundleB strong preference over BundleA.

Alternatively, you can filter BundleA from BundleC target platform as
explain in [1]

[1] https://wiki.eclipse.org/Tycho/Target_Platform#Filtering

--
Regards,
Igor

On 2014-03-31, 11:43, Neil Corbet wrote:
Hello All,

I have a scenario where I need to make sure one bundle compiles against
another.

Here is my scenario:

BundleA exposes package *my.company.org.dao*.  This bundle uses spring
to create mock objects against interfaces in said package. These mock
objects are exposed as services that a UnitTest bundle (
eclipse-test-plugin) uses strictly for unit testing a service
implementation bundle.

BundleB exposes the same package *my.company.org.dao*. But these
interfaces extend spring data PagingAndSortingRepository, which the
mocking framework does not like.

BundleC imports *package my.company.org.dao*. I need this one to compile
against BundleB and not BundleA.

When I built my product and installed it, I kept getting an error when
using one of my services that a method was not found. It seems it was
compiling BundleC against BundleA's dao package and not the ones in
BundleB extending the spring data interfaces. BundleA is not in the
feature that defines my product.

Is there a way to use the maven tycho compiler plugin to  compile
against BundleB and not BundleA?

Thanks,

Neil


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



Back to the top