Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352034 - Incorrect value for ${project.artifactId} in parent project with target-platform-configuration
Summary: Incorrect value for ${project.artifactId} in parent project with target-platf...
Status: CLOSED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-13 18:10 EDT by Robert Munteanu CLA
Modified: 2021-04-28 16:55 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Munteanu CLA 2011-07-13 18:10:34 EDT
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 .
Comment 1 Igor Fedorenko CLA 2011-07-14 00:46:02 EDT
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.