| Summary: | Incorrect value for ${project.artifactId} in parent project with target-platform-configuration | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Robert Munteanu <robert.munteanu> |
| Component: | Tycho | Assignee: | Project Inbox <tycho-inbox> |
| Status: | CLOSED INVALID | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | CC: | igor |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
This is expected and correct behaviour. ${project.artifactId} and other properties are expanded in the context of each child module that inherits project configuration elements from parent pom.xml.
|
I have set up a target file which is contained and attached to the parent project of a tycho build. I tried to configure the target artifact using ${project.*} properties: bc. <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>target-platform-configuration</artifactId> <version>${tycho-version}</version> <configuration> <resolver>p2</resolver> <target> <artifact> <groupId>${project.groupId}</groupId> <artifactId>${project.artifactId}</artifactId> <version>${project.version}</version> <classifier>mantis</classifier> </artifact> </target> </configuration> </plugin> With this configuration the target platform resolution fails: bc. Internal error: java.lang.RuntimeException: java.io.FileNotFoundException: /home/robert/git-repos/mylyn-mantis/com.itsolut.mantis.core/mantis.target (No such file or directory) -> [Help 1] org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: java.io.FileNotFoundException: /home/robert/git-repos/mylyn-mantis/com.itsolut.mantis.core/mantis.target (No such file or directory) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:168) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /home/robert/git-repos/mylyn-mantis/com.itsolut.mantis.core/mantis.target (No such file or directory) at org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader.getTarget(DefaultTargetPlatformConfigurationReader.java:197) at org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader.getTargetPlatformConfiguration(DefaultTargetPlatformConfigurationReader.java:58) at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.setupProject(DefaultTychoDependencyResolver.java:72) at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:85) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:273) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) ... 11 more Caused by: java.io.FileNotFoundException: /home/robert/git-repos/mylyn-mantis/com.itsolut.mantis.core/mantis.target (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:120) at org.eclipse.tycho.model.Target.read(Target.java:132) at org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader.getTarget(DefaultTargetPlatformConfigurationReader.java:195) ... 16 more The issue here is that the file is looked for in the com.itsolut.mantis.core directory, whereas the ${project.artifactId} property should resolve to com.itsolut.mantis.parent . If I replace ${project.artifactId} with com.itsolut.mantis.parent , the artifact is correctly attached. The project can be viewed at / cloned from https://github.com/Mylyn-Mantis/mylyn-mantis .