Hi all,

I have used the tycho-equinox to wrote a custom plugin which is used to
install the features and create the product. The reason I have created my
own plugin (instead of using tycho-maven-plugin) was to have my own
parameters in the pom.xml of the feature and in the product. The
tycho-equinox version 0.13.0 and it works without any issue.

I now have a requirement to define a custom p2 touchpoint. As per [1], this
is supported from tycho version 0.16.0 and using the <directorRuntime> as
standalone in the product pom (referred [2]). Therefore I have upgraded my
custom plugin's dependency of tycho to 0.23.1 and used the from my code
called the StandaloneDirectorRuntimeFactory class. The issue that I am
facing here is in the code below:

Artifact artifact =
repositorySystem.createArtifact("org.eclipse.tycho",
"tycho-standalone-p2-director",

        TychoVersion.getTychoVersion(), "eclipse-repository");

In my code during runtime (product building), it calls the default
implementation of createArtifact and not the implementation in
LegacyRepositorySystem class. Because of this am not getting the correct
location of the zip file from the local repository (.m2). How do I fix this
so that it pulls from the implementation class (LegacyRepositorySystem),
i.e., the same way as tycho-p2-director-plugin in my custom p2 plugin?

As a workaround, I put the following in my product pom but this gives an
error [3]. Any idea as to why this is?

<plugin>
    <groupId>org.eclipse.tycho</groupId>
    <artifactId>tycho-maven-plugin</artifactId>
    <version>0.23.1</version>
    <extensions>true</extensions>
</plugin>


[1] - https://bugs.eclipse.org/bugs/show_bug.cgi?id=351487
[2] -
https://github.com/eclipse/tycho/blob/master/tycho-its/projects/product.metaRequirements/product/pom.xml#L40
[3] -
[ERROR] Internal error: java.lang.ClassCastException:
org.eclipse.tycho.core.osgitools.DefaultReactorProject cannot be cast to
org.eclipse.tycho.ReactorProject -> [Help 1]
org.apache.maven.InternalErrorException: Internal error:
java.lang.ClassCastException:
org.eclipse.tycho.core.osgitools.DefaultReactorProject cannot be cast to
org.eclipse.tycho.ReactorProject
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:121)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
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:497)
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.ClassCastException:
org.eclipse.tycho.core.osgitools.DefaultReactorProject cannot be cast to
org.eclipse.tycho.ReactorProject
at
org.eclipse.tycho.core.osgitools.DefaultReactorProject.adapt(DefaultReactorProject.java:45)
at
org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:70)
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
[ERROR]


Regards,
Nira

-- 
*Niranjan Karunanandham*
_______________________________________________
equinox-dev mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev

Reply via email to