Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mirror mojo does not seem to work for target platforms #176

Closed
rcspirent opened this issue Jul 7, 2021 · 3 comments
Closed

Mirror mojo does not seem to work for target platforms #176

rcspirent opened this issue Jul 7, 2021 · 3 comments
Milestone

Comments

@rcspirent
Copy link

rcspirent commented Jul 7, 2021

Trying to use tycho-p2-extras-plugin:mirror mojo to mirror a targetplatform which should be possible according to https://www.eclipse.org/tycho/sitedocs/tycho-extras/tycho-p2-extras-plugin/mirror-mojo.html#targetPlatformAsSource but I couldn't find an example or further info anywhere.
So I tried around but couldn't figure it out.

Example pom

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>example.p2mirror</groupId>
	<artifactId>targetplatform.mirror</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>eclipse-repository</packaging>
	<name>targetplatform mirror</name>

	<properties>
		<tycho-version>2.3.0</tycho-version>
	</properties>

	<build>
		<plugins>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-maven-plugin</artifactId>
				<version>${tycho-version}</version>
				<extensions>true</extensions>
			</plugin>
			<plugin>
				<groupId>org.eclipse.tycho.extras</groupId>
				<artifactId>tycho-p2-extras-plugin</artifactId>
				<version>${tycho-version}</version>
				<executions>
					<execution>
						<phase>prepare-package</phase>
						<goals>
							<goal>mirror</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<ignoreErrors>false</ignoreErrors>
					<includeOptional>true</includeOptional>
					<includeNonGreedy>false</includeNonGreedy>
					<filter>
					</filter>
					<latestVersionOnly>true</latestVersionOnly>
					<mirrorMetadataOnly>false</mirrorMetadataOnly>
					<compress>false</compress>
					<append>false</append>
					<includePacked>true</includePacked>
					<targetPlatformAsSource>true</targetPlatformAsSource>
					<currentModuleAsSource>false</currentModuleAsSource>
					<source>
					</source>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-p2-plugin</artifactId>
				<version>${tycho-version}</version>
			</plugin>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>target-platform-configuration</artifactId>
				<version>${tycho-version}</version>
				<configuration>
					<allowConflictingDependencies>true</allowConflictingDependencies>
					<target>
						<file>custom.target</file>
					</target>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>

Execution via mvn package results in a mostly empty p2 repository.
Direct mojo execution results in

[ERROR] Failed to execute goal org.eclipse.tycho.extras:tycho-p2-extras-plugin:2.3.0:mirror (default-cli) on project targetplatform.mirror: Execution default-cli of goal org.eclipse.tycho.extras:tycho-p2-extras-plugin:2.3.0:mirror failed: Tycho build extension not configured for MavenProject: example.p2mirror:targetplatform.mirror:0.0.1-SNAPSHOT @ C:\dev\eclipse_ws\targetplatform.mirror\pom.xml -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho.extras:tycho-p2-extras-plugin:2.3.0:mirror (default-cli) on project targetplatform.mirror: Execution default-cli of goal org.eclipse.tycho.extras:tycho-p2-extras-plugin:2.3.0:mirror failed: Tycho build extension not configured for MavenProject: example.p2mirror:targetplatform.mirror:0.0.1-SNAPSHOT @ C:\dev\eclipse_ws\targetplatform.mirror\pom.xml
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:215)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.eclipse.tycho.extras:tycho-p2-extras-plugin:2.3.0:mirror failed: Tycho build extension not configured for MavenProject: example.p2mirror:targetplatform.mirror:0.0.1-SNAPSHOT @ C:\dev\eclipse_ws\targetplatform.mirror\pom.xml
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:148)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
	... 20 more
Caused by: java.lang.IllegalStateException: Tycho build extension not configured for MavenProject: example.p2mirror:targetplatform.mirror:0.0.1-SNAPSHOT @ C:\dev\eclipse_ws\targetplatform.mirror\pom.xml
	at org.eclipse.tycho.core.utils.TychoProjectUtils.getTargetPlatform(TychoProjectUtils.java:70)
	at org.eclipse.tycho.p2.facade.RepositoryReferenceTool.addTargetPlatformRepository(RepositoryReferenceTool.java:118)
	at org.eclipse.tycho.p2.facade.RepositoryReferenceTool.getVisibleRepositories(RepositoryReferenceTool.java:98)
	at org.eclipse.tycho.plugins.p2.extras.MirrorMojo.execute(MirrorMojo.java:234)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
	... 21 more
@LorenzoBettini
Copy link
Contributor

I was trying to figure out how to use that option. Any suggestions, please?

@laeubi
Copy link
Member

laeubi commented Dec 28, 2021

I was trying to figure out how to use that option. Any suggestions, please?

The best option is to create a small (github) project showing the error then we can discuss/improve on it.

@LorenzoBettini
Copy link
Contributor

@laeubi I didn't experience any error: I simply have no idea on how to use that option..

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants