Discussion:
Target Platform Definition: Could not resolve target platform specification artifact
(too old to reply)
R***@dlr.de
2018-04-05 07:57:10 UTC
Permalink
Hi,
I am trying to add target definition to my Eclipse RCP project, but the build fails with the following output:

[INFO] Scanning for projects...
[ERROR] Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact assist:ch.hilbri.assist.releng.targetplatform:target:1.0.1-SNAPSHOT -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact assist:ch.hilbri.assist.releng.targetplatform:target:1.0.1-SNAPSHOT

I defined a target platform definition in a separate project [1]:

<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>
<artifactId>ch.hilbri.assist.releng.targetplatform</artifactId>
<packaging>eclipse-target-definition</packaging>
<parent>
<groupId>assist</groupId>
<artifactId>ch.hilbri.assist.releng</artifactId>
<version>2.4.0-SNAPSHOT</version>
<relativePath>../ch.hilbri.assist.releng</relativePath>
</parent>
</project>

I added this project to the main pom [2]:

...
<modules>
...
<module>../ch.hilbri.assist.releng.targetplatform</module>
...
</modules>
...
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<target>
<artifact>
<groupId>assist</groupId>
<artifactId>ch.hilbri.assist.releng.targetplatform</artifactId>
<version>${project.version}</version>
</artifact>
</target>
..

Do you have an idea, what is wrong with this configuration? The entire code is available on GitHub [3]. The target platform works with Eclipse.

Thank you for any pointers...

Best,
Robert


[1]: https://github.com/RobertHilbrich/assist-public/blob/master/ch.hilbri.assist.releng.targetplatform/pom.xml
[2]: https://github.com/RobertHilbrich/assist-public/blob/master/ch.hilbri.assist.releng/pom.xml
[3]: https://github.com/RobertHilbrich/assist-public




--------------------------
Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)
Institut für Verkehrssystemtechnik | Rutherfordstraße 2 | 12489 Berlin

Dr. Robert Hilbrich | Gruppenleiter Simulation und Modellierung
Telefon 030 67055-582 | Telefax 030 67055-291 | ***@dlr.de<mailto:***@dlr.de>
www.DLR.de<http://www.dlr.de/> | Institut für Verkehrssystemtechnik<http://www.dlr.de/ts>
Mickael Istria
2018-04-05 08:05:49 UTC
Permalink
Hi,

The error message is relatively explicit. It says it cannot find version
1.0.1-SNAPSHOT of your .target artifact, and indeed, the artifact is
actually in version 2.4.0-SNAPSHOT. You should avoid using
${project.version} to reference your eclipse-target-definition module if
the bundles that use it have different versions. As a reminder, this
${project.version} is resolved for each module, so it basically will
resolve to the version of the bundle being build, not to the version of the
pom that declares the plugin configuration.

HTH
R***@dlr.de
2018-04-05 09:01:04 UTC
Permalink
Hi,
I changed the parent pom [1] according to your mail:

<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<target>
<artifact>
<groupId>assist</groupId>
<artifactId>ch.hilbri.assist.releng.targetplatform</artifactId>
<version>2.4.0-SNAPSHOT</version>
</artifact>
</target>


But the error remains:

[INFO] Scanning for projects...
[ERROR] Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact assist:ch.hilbri.assist.releng.targetplatform:target:2.4.0-SNAPSHOT -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact assist:ch.hilbri.assist.releng.targetplatform:target:2.4.0-SNAPSHOT
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:121)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.RuntimeException: Could not resolve target platform specification artifact assist:ch.hilbri.assist.releng.targetplatform:target:2.4.0-SNAPSHOT
at org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader.addTargetArtifact(DefaultTargetPlatformConfigurationReader.java:389)
at org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader.setTarget(DefaultTargetPlatformConfigurationReader.java:342)
at org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader.getTargetPlatformConfiguration(DefaultTargetPlatformConfigurationReader.java:75)
at org.eclipse.tycho.core.resolver.DefaultTychoResolver.setupProject(DefaultTychoResolver.java:87)
at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:90)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:266)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
... 11 more


I think this is something else
 but I have no idea, where to look :/ Any more ideas?

Best,
Robert


[1]: https://github.com/RobertHilbrich/assist-public/blob/master/ch.hilbri.assist.releng/pom.xml


From: tycho-user-***@eclipse.org [mailto:tycho-user-***@eclipse.org] On Behalf Of Mickael Istria
Sent: Thursday, April 05, 2018 10:06 AM
To: Tycho user list
Subject: Re: [tycho-user] Target Platform Definition: Could not resolve target platform specification artifact

Hi,
The error message is relatively explicit. It says it cannot find version 1.0.1-SNAPSHOT of your .target artifact, and indeed, the artifact is actually in version 2.4.0-SNAPSHOT. You should avoid using ${project.version} to reference your eclipse-target-definition module if the bundles that use it have different versions. As a reminder, this ${project.version} is resolved for each module, so it basically will resolve to the version of the bundle being build, not to the version of the pom that declares the plugin configuration.
HTH
R***@dlr.de
2018-04-05 11:03:57 UTC
Permalink
Hi,
I think I got it working by cleaning everything and having a fresh start on travis CI. Tycho is now picking up the target definition file properly, so this issue can be considered as being closed.
Thanks for your insights and the time you took to look into this matter.
Cheers,
Robert

From: Hilbrich, Robert
Sent: Thursday, April 05, 2018 11:01 AM
To: 'Tycho user list'
Subject: RE: [tycho-user] Target Platform Definition: Could not resolve target platform specification artifact

Hi,
I changed the parent pom [1] according to your mail:

<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<target>
<artifact>
<groupId>assist</groupId>
<artifactId>ch.hilbri.assist.releng.targetplatform</artifactId>
<version>2.4.0-SNAPSHOT</version>
</artifact>
</target>


But the error remains:

[INFO] Scanning for projects...
[ERROR] Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact assist:ch.hilbri.assist.releng.targetplatform:target:2.4.0-SNAPSHOT -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact assist:ch.hilbri.assist.releng.targetplatform:target:2.4.0-SNAPSHOT
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:121)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.RuntimeException: Could not resolve target platform specification artifact assist:ch.hilbri.assist.releng.targetplatform:target:2.4.0-SNAPSHOT
at org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader.addTargetArtifact(DefaultTargetPlatformConfigurationReader.java:389)
at org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader.setTarget(DefaultTargetPlatformConfigurationReader.java:342)
at org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader.getTargetPlatformConfiguration(DefaultTargetPlatformConfigurationReader.java:75)
at org.eclipse.tycho.core.resolver.DefaultTychoResolver.setupProject(DefaultTychoResolver.java:87)
at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:90)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:266)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
... 11 more


I think this is something else
 but I have no idea, where to look :/ Any more ideas?

Best,
Robert


[1]: https://github.com/RobertHilbrich/assist-public/blob/master/ch.hilbri.assist.releng/pom.xml


From: tycho-user-***@eclipse.org<mailto:tycho-user-***@eclipse.org> [mailto:tycho-user-***@eclipse.org] On Behalf Of Mickael Istria
Sent: Thursday, April 05, 2018 10:06 AM
To: Tycho user list
Subject: Re: [tycho-user] Target Platform Definition: Could not resolve target platform specification artifact

Hi,
The error message is relatively explicit. It says it cannot find version 1.0.1-SNAPSHOT of your .target artifact, and indeed, the artifact is actually in version 2.4.0-SNAPSHOT. You should avoid using ${project.version} to reference your eclipse-target-definition module if the bundles that use it have different versions. As a reminder, this ${project.version} is resolved for each module, so it basically will resolve to the version of the bundle being build, not to the version of the pom that declares the plugin configuration.
HTH

Continue reading on narkive:
Loading...