osgi - Maven Tycho dependency resolution fails after switching from 1.7.0 to 2.7.5 - Stack Overflow

I have some OSGi artifacts (Eclipse plugins) built using Tycho. Then I have some other project building

I have some OSGi artifacts (Eclipse plugins) built using Tycho. Then I have some other project building a Debian package with those artifacts included (own MOJO). The OSGi artifacts are declared as simple POM dependencies in the Debian package project POM.

Everything worked well until now, when I switched from Tycho 1.7.0 to 2.7.5. I have to switch because I need some other feature ("wrapAsBundle"). In the dependency resolution phase there are now some artifacts not found in the repository (own hosted Artifactory) and the build fails. It seems strange that there is something *.eclipse-plugin pulled which does not exist in the repository.

Before changes:

[INFO] Downloading from xyz.repository.snapshot: /artifactory/xyz-snapshot/xyz/xyz.service.ticket/1.0.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded from xyz.repository.snapshot: /artifactory/xyz-snapshot/xyz/xyz.service.ticket/1.0.0-SNAPSHOT/maven-metadata.xml (1.3 kB at 80 kB/s)
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ xyz.os.runtime ---

After changes:

[DEBUG] Skipped remote request for xyz.service:xyz.service.ticket:1.0.0-SNAPSHOT/maven-metadata.xml, already updated during this session.
[DEBUG] Using transporter WagonTransporter with priority -1.0 for /artifactory/xyz-snapshot/
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for /artifactory/xyz-snapshot/ with username=abc, password=***
[INFO] Downloading from xyz.repository.snapshot: /artifactory/xyz-snapshot/xyz/xyzmon.data/1.0.0-SNAPSHOT/xyzmon.data-1.0.0-SNAPSHOT.eclipse-plugin
[DEBUG] Writing tracking file /home/gitlab-runner/.m2/repository/xyz/common/xyzmon.data/1.0.0-SNAPSHOT/xyzmon.data-1.0.0-SNAPSHOT.eclipse-plugin.lastUpdated
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.942 s
[INFO] Finished at: 2024-11-15T21:36:23+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project xyz.os.runtime: Could not resolve dependencies for project xyz.os:xyz.os.runtime:debian:3.7.0.20241115213614-testing: Could not find artifact xyz.os.runtimemon:xyz.os.runtimemon.data:eclipse-plugin:1.0.0-SNAPSHOT in technology.xyz.repository.snapshot (/artifactory/xyz-snapshot/) -> [Help 1]
.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project xyz.os.runtime: Could not resolve dependencies for project xyz.os:xyz.os.runtime:debian:3.7.0.20241115213614-testing: Could not find artifact xyz.os.runtimemon:xyz.os.runtimemon.data:eclipse-plugin:1.0.0-SNAPSHOT in xyz.repository.snapshot (/artifactory/xyz-snapshot/)
    at .apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:269)
    at .apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:147)
    at .apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:248)
    at .apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:202)
    at .apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)

Tycho configuration:

<plugin>
    <groupId>.eclipse.tycho</groupId>
    <artifactId>tycho-compiler-plugin</artifactId>
    <version>${tycho.version}</version>
</plugin>
<plugin>
    <groupId>.eclipse.tycho</groupId>
    <artifactId>tycho-maven-plugin</artifactId>
    <version>${tycho.version}</version>
    <extensions>true</extensions>
</plugin>
<plugin>
    <groupId>.eclipse.tycho</groupId>  
    <artifactId>tycho-versions-plugin</artifactId>  
    <version>${tycho.version}</version>  
</plugin>
<plugin>
    <groupId>.eclipse.tycho</groupId>
    <artifactId>target-platform-configuration</artifactId>
    <version>${tycho.version}</version>
    <configuration>
        <pomDependencies>wrapAsBundle</pomDependencies>
    </configuration>
</plugin>

I have some OSGi artifacts (Eclipse plugins) built using Tycho. Then I have some other project building a Debian package with those artifacts included (own MOJO). The OSGi artifacts are declared as simple POM dependencies in the Debian package project POM.

Everything worked well until now, when I switched from Tycho 1.7.0 to 2.7.5. I have to switch because I need some other feature ("wrapAsBundle"). In the dependency resolution phase there are now some artifacts not found in the repository (own hosted Artifactory) and the build fails. It seems strange that there is something *.eclipse-plugin pulled which does not exist in the repository.

Before changes:

[INFO] Downloading from xyz.repository.snapshot: https://repository.xyz/artifactory/xyz-snapshot/xyz/xyz.service.ticket/1.0.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded from xyz.repository.snapshot: https://repository.xyz/artifactory/xyz-snapshot/xyz/xyz.service.ticket/1.0.0-SNAPSHOT/maven-metadata.xml (1.3 kB at 80 kB/s)
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ xyz.os.runtime ---

After changes:

[DEBUG] Skipped remote request for xyz.service:xyz.service.ticket:1.0.0-SNAPSHOT/maven-metadata.xml, already updated during this session.
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://repository.xyz/artifactory/xyz-snapshot/
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://repository.xyz/artifactory/xyz-snapshot/ with username=abc, password=***
[INFO] Downloading from xyz.repository.snapshot: https://repository.xyz/artifactory/xyz-snapshot/xyz/xyzmon.data/1.0.0-SNAPSHOT/xyzmon.data-1.0.0-SNAPSHOT.eclipse-plugin
[DEBUG] Writing tracking file /home/gitlab-runner/.m2/repository/xyz/common/xyzmon.data/1.0.0-SNAPSHOT/xyzmon.data-1.0.0-SNAPSHOT.eclipse-plugin.lastUpdated
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.942 s
[INFO] Finished at: 2024-11-15T21:36:23+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project xyz.os.runtime: Could not resolve dependencies for project xyz.os:xyz.os.runtime:debian:3.7.0.20241115213614-testing: Could not find artifact xyz.os.runtimemon:xyz.os.runtimemon.data:eclipse-plugin:1.0.0-SNAPSHOT in technology.xyz.repository.snapshot (https://repository.xyz/artifactory/xyz-snapshot/) -> [Help 1]
.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project xyz.os.runtime: Could not resolve dependencies for project xyz.os:xyz.os.runtime:debian:3.7.0.20241115213614-testing: Could not find artifact xyz.os.runtimemon:xyz.os.runtimemon.data:eclipse-plugin:1.0.0-SNAPSHOT in xyz.repository.snapshot (https://repository.xyz/artifactory/xyz-snapshot/)
    at .apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:269)
    at .apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:147)
    at .apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:248)
    at .apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:202)
    at .apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)

Tycho configuration:

<plugin>
    <groupId>.eclipse.tycho</groupId>
    <artifactId>tycho-compiler-plugin</artifactId>
    <version>${tycho.version}</version>
</plugin>
<plugin>
    <groupId>.eclipse.tycho</groupId>
    <artifactId>tycho-maven-plugin</artifactId>
    <version>${tycho.version}</version>
    <extensions>true</extensions>
</plugin>
<plugin>
    <groupId>.eclipse.tycho</groupId>  
    <artifactId>tycho-versions-plugin</artifactId>  
    <version>${tycho.version}</version>  
</plugin>
<plugin>
    <groupId>.eclipse.tycho</groupId>
    <artifactId>target-platform-configuration</artifactId>
    <version>${tycho.version}</version>
    <configuration>
        <pomDependencies>wrapAsBundle</pomDependencies>
    </configuration>
</plugin>
Share Improve this question edited Nov 16, 2024 at 12:24 Martin asked Nov 16, 2024 at 11:42 MartinMartin 1721 silver badge12 bronze badges 6
  • 1 Note that the current version of Tycho is 4.0.10 – greg-449 Commented Nov 16, 2024 at 12:17
  • Yes, but my projects are on Java 11. – Martin Commented Nov 16, 2024 at 12:21
  • If I change the packaging of the related OSGi artifacts to 'jar' the everything in the debian project is resolved. However, then project dependency resolution fails. It must be something about changes with the packaging type and resolver. – Martin Commented Nov 16, 2024 at 12:48
  • Seems related: github/eclipse-tycho/tycho/issues/2005 – Martin Commented Nov 16, 2024 at 13:13
  • 2 The fact that your projects are on Java 11 should not prevent you from using the latest Tycho version. – howlger Commented Nov 16, 2024 at 16:51
 |  Show 1 more comment

1 Answer 1

Reset to default 0

It seems this is fixed starting from Tycho 3.0.x: https://github/eclipse-tycho/tycho/pull/2011/commits/fdd9a7f09667106783048d61898d5d0091437975

replaceTypeWithExtension needs to be set to true then.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745659055a4638722.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信