Skip to content

Maven artifacts deployed with Tycho 2.7 are resolved without transitive dependencies by Maven #781

Closed
@LorenzoBettini

Description

I've just found a problem in my Maven artifacts released to Central with Tycho 2.27 (maybe it's due to the new https://github.com/eclipse/tycho/blob/master/RELEASE_NOTES.md#mixed-reactor-build-support ?)

For my projects (Xtext projects, but I think that has nothing to do with my problem), I've always released with Tycho both p2 sites and some Maven artifacts to Maven central (they are Eclipse bundles but deployed to Maven central). For such projects, I've always repeated in the POM the Maven dependencies, since, when consumed by pure Maven, the MANIFEST dependencies are not taken into consideration.

This is an example of an artifact that is a bundle and it's deployed to Maven central as well

<project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>io.github.lorenzobettini.edelta</groupId>
    <artifactId>edelta.parent</artifactId>
    <version>2.9.0-SNAPSHOT</version>
  </parent>
  <artifactId>edelta.lib</artifactId>
  <packaging>eclipse-plugin</packaging>

  <dependencies>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.xtext</groupId>
      <artifactId>org.eclipse.xtext.xbase.lib</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.emf</groupId>
      <artifactId>org.eclipse.emf.ecore.xmi</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.emf</groupId>
      <artifactId>org.eclipse.emf.ecore</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.emf</groupId>
      <artifactId>org.eclipse.emf.common</artifactId>
    </dependency>
  </dependencies>
</project>

the version numbers are configured in the dependency management section of the parent.

This is the POM of 2.8.0 released with Tycho 2.26: https://repo1.maven.org/maven2/io/github/lorenzobettini/edelta/edelta.lib/2.8.0/edelta.lib-2.8.0.pom which looks fine.

If consumed in a pure Maven project, transitive dependencies are correctly resolved (see that from Eclipse):

image

After I switched to Tycho 2.27, things do not seem to work anymore...

For example, this is the POM of 2.9.0 released with Tycho 2.27:
https://repo1.maven.org/maven2/io/github/lorenzobettini/edelta/edelta.lib/2.9.0/edelta.lib-2.9.0.pom

This contains the compile scope dependencies, but then it contains lots of other stuff (generated by Tycho I guess?).

The problem is that if I try to consume this artifact version from Maven, the artifact is resolved, but not the transitive dependencies (which of course it's likely to generate lots of compilation errors, see the error marker in the Java code, even if I run Maven from the command line):

image

Is that related to the new https://github.com/eclipse/tycho/blob/master/RELEASE_NOTES.md#mixed-reactor-build-support ?

Should I change some configurations in my POMs?

I had a look at https://github.com/eclipse/tycho/blob/master/tycho-its/projects/mixed.reactor/pom.xml and I see the use of "consider" (which I never had to use in the past) and also this https://github.com/eclipse/tycho/blob/master/tycho-its/projects/mixed.reactor/pom.xml#L68 configuration of the tycho-p2-plugin...

Thanks in advance

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions